docker命令管理docker镜像

一、使用docker命令管理docker镜像
1.使用docker命令下载ubuntu:18.04和ubuntu:latest镜像
2.使用docker命令下载hub.c.163.com/library/centos:7.4.1708镜像

[root@localhost ~]# docker pull ubuntu:18.04
18.04: Pulling from library/ubuntu
726b8a513d66: Pull complete 
Digest: sha256:6fec50623d6d37b7f3c14c5b6fc36c73fd04aa8173d59d54dba00da0e7ac50ee
Status: Downloaded newer image for ubuntu:18.04
docker.io/library/ubuntu:18.04
[root@localhost ~]# docker pull ubuntu:latest
latest: Pulling from library/ubuntu
2b55860d4c66: Pull complete 
Digest: sha256:20fa2d7bb4de7723f542be5923b06c4d704370f0390e4ae9e1c833c8785644c1
Status: Downloaded newer image for ubuntu:latest
docker.io/library/ubuntu:latest
[root@localhost ~]# docker images
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
ubuntu       18.04     35b3f4f76a24   8 hours ago   63.1MB
ubuntu       latest    2dc39ba059dc   5 days ago    77.8MB
[root@localhost ~]# docker pull hub.c.163.com/library/centos:7.4.1708
7.4.1708: Pulling from library/centos
840caab23da4: Pull complete 
Digest: sha256:78b63c089c40a2ca0d85db9125fb3193c6ff74814bba5f894c803e5ae02a4035
Status: Downloaded newer image for hub.c.163.com/library/centos:7.4.1708
hub.c.163.com/library/centos:7.4.1708
[root@localhost ~]# docker images
REPOSITORY                     TAG        IMAGE ID       CREATED       SIZE
ubuntu                         18.04      35b3f4f76a24   8 hours ago   63.1MB
ubuntu                         latest     2dc39ba059dc   5 days ago    77.8MB
hub.c.163.com/library/centos   7.4.1708   9f266d35e02c   3 years ago   197MB

3.使用docker命令通过ubuntu:18.04镜像生成容器,容器在后台运行,且容器名为myubuntu

[root@localhost ~]# docker run -it -d --name myubuntu ubuntu:18.04
fcb17aae2ab09aa15467bf2f05e247d414236985fcb9607663
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值