docker_work_with_images

默认为root权限
1、Listing images on the host
docker images

2、listing runing container
docker ps

3、get images
(1)、docker run -t -i ubuntu:14.04 /bin/sh #若local没有ubuntu14.04的image,能联网则会从 Docker Hub下载
(2)、docker pull ubuntu:14.04
(2)与(1)不同的是,pull会预先下载(Well Docker will automatically download any image we use that isn't
already present on the Docker host. But this can potentially add some time to the launch of a container.
 If we want to pre-load an image we can download it using the docker pull command. Let's say we'd like
to download the centos image.)
总之,(1)登录到容器慢些(2)快些
(3)dockerfile
dockerfile 一般为
FROM baseimage
MAINTAINER kate smith <ksmith@example.com>
RUN ...
RUN ...
使用docker build -t name/space . #须在dockerfile所在目录下执行该命令,注意.的存在

4、updating and commiting an images
docker commit -m “message” -a "john" #-m version info -a author info

5、find images
docker search ubunte #从local和docker hub查找images

6、Setting tags on an image
你可以为commit or build 的image 设置tag
docker tag 5db5f8471261 ouruser/sinatra:devel

7、Push an image to Docker Hub
一旦你build or create image,你可以上传到docker Hub与别人share,你也可以上传到自己的private reposity。
docker push ouruser/sinatra

8、Remove an image from the host
从local删除image
docker rmi training/sinatra
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值