标签:ZKM mic lfs avl 指令 jic bmc sid docker镜像
[root@docker ~]# docker build -t centos-vim-file . Sending build context to Docker daemon 49.66kB Step 1/2 : FROM centos:centos7.4.1708 ---> 9f266d35e02c Step 2/2 : RUN yum -y update && yum -y install vim ---> Running in 88ac2e84751b ...... ...... Removing intermediate container 88ac2e84751b ---> cc0a0d552187 Successfully built cc0a0d552187 Successfully tagged centos-vim-file:latest
[root@docker ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE centos centos7.4.1708 9f266d35e02c 11 months ago 197MB
[root@docker ~]# pwd
/root
vim Dockerfile FROM centos:centos7.4.1708 RUN yum -y update && yum -y install vim
[root@docker ~]# docker build -t centos-vim-file .
Sending build context to Docker daemon 49.66kB
Step 1/2 : FROM centos:centos7.4.1708 ---> 9f266d35e02c
Step 2/2 : RUN yum -y update && yum -y install vim
---> Running in 88ac2e84751b
。。。。。。
Removing intermediate container 88ac2e84751b
---> cc0a0d552187
Successfully built cc0a0d552187
Successfully tagged centos-vim-file:latest
centos-vim-file 与 centos:centos7.4.1708 镜像相比,确实只是多了顶部的一层 cc0a0d552187,由 yum 命令创建,大小为 326MB。docker history 也向我们展示了镜像的分层结构,每一层由上至下排列。
004Docker学习__Dockerfile_build命令构建docker镜像
标签:ZKM mic lfs avl 指令 jic bmc sid docker镜像
原文地址:https://www.cnblogs.com/lizhi199322/p/13207377.html