苏州城乡和住房建设局网站首页网页登录页面设计模板
web/
2025/10/3 6:15:09/
文章来源:
苏州城乡和住房建设局网站首页,网页登录页面设计模板,小程序是什么,金华企业制作网站Docker 的image是运行的基本.例如我们build一个image时, 在Dockerfile每条指令会产生一个可读写的image, 下一条指令使用上一条指令产生的image为基础, 继续产生image(然后删除上一个image), 如果指令没有对image有修改的动作, 那么可以使用image cache. 所有的指令执行完, 生成… Docker 的image是运行的基本. 例如我们build一个image时, 在Dockerfile每条指令会产生一个可读写的image, 下一条指令使用上一条指令产生的image为基础, 继续产生image(然后删除上一个image), 如果指令没有对image有修改的动作, 那么可以使用image cache. 所有的指令执行完, 生成最终的image. 然后我们就可以使用image来创建并运行container了. 例如我当前本地有一个images, centos, TAG是centos5, 我需要使用它作为base image, 来创建我自己的image.[root150 docker]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
centos centos5 d5844d902074 2 days ago 467.1 MB 创建一个空目录, 并在这个空目录中写一个简单的Dockerfile内容如下 : # vi Dockerfile
FROM centos:centos5
CMD [-l]
ENTRYPOINT [ls] 使用docker build .来创建image.[root150 docker]# docker build .
Sending build context to Docker daemon 2.56 kB
Sending build context to Docker daemon
Step 0 : FROM centos:centos5--- d5844d902074 # 这个ID是centos:centos5的IMAGE id
Step 1 : CMD [-l]--- Running in 9fd2f16fcf97 # 这个ID是执行第一条指令CMD [-l]时产生的中间过程IMAGE ID--- e253cb9b0ea4 # 这个ID是执行第一条指令CMD [-l]后产生的IMAGE ID
Removing intermediate container 9fd2f16fcf97 # 移除中间image
Step 2 : ENTRYPOINT [ls]--- Running in 52c06c9fae1b --- a18fae31b310
Removing intermediate container 52c06c9fae1b
Successfully built a18fae31b310 # 最终的ID, 可以使用docker images看到这个ID [root150 docker]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
none none a18fae31b310 14 minutes ago 467.1 MB
centos centos5 d5844d902074 2 days ago 467.1 MB 使用这个image运行[root150 docker]# docker run a18fae31b310
total 64
drwxr-xr-x 2 root root 4096 Sep 26 12:21 bin
drwxr-xr-x 4 root root 340 Sep 30 10:29 dev
drwxr-xr-x 39 root root 4096 Sep 30 10:29 etc
drwxr-xr-x 2 root root 4096 May 11 2011 home
drwxr-xr-x 6 root root 4096 Sep 26 12:20 lib
drwxr-xr-x 7 root root 4096 Sep 26 12:20 lib64
drwx------ 2 root root 4096 Sep 26 12:19 lostfound
drwxr-xr-x 2 root root 4096 May 11 2011 media
drwxr-xr-x 2 root root 4096 May 11 2011 mnt
drwxr-xr-x 2 root root 4096 May 11 2011 opt
dr-xr-xr-x 372 root root 0 Sep 30 10:29 proc
drwxr-x--- 2 root root 4096 May 11 2011 root
drwxr-xr-x 2 root root 4096 Sep 26 12:21 sbin
drwxr-xr-x 3 root root 4096 Sep 26 12:21 selinux
drwxr-xr-x 2 root root 4096 May 11 2011 srv
drwxr-xr-x 13 root root 0 Sep 30 2014 sys
drwxrwxrwt 2 root root 4096 Sep 26 12:21 tmp
drwxr-xr-x 14 root root 4096 Sep 26 12:20 usr
drwxr-xr-x 17 root root 4096 Sep 26 12:19 var[root150 docker]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ae77e79c4f58 a18fae31b310 ls -l 29 seconds ago Exited (0) 28 seconds ago desperate_lovelace [root150 docker]# docker rm ae77e79c4f58
ae77e79c4f58
[root150 docker]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESimage的介绍 : Introduction In Docker terminology, a read-only Layer is called an image. An image never changes. Since Docker uses a Union File System, the processes think the whole file system is mounted read-write. But all the changes go to the top-most writeable layer, and underneath, the original file in the read-only image is unchanged. Since images dont change, images do not have state. Parent Image Each image may depend on one more image which forms the layer beneath it. We sometimes say that the lower image is the parent of the upper image. Base Image An image that has no parent is a base image. Image IDs All images are identified by a 64 hexadecimal digit string (internally a 256bit value). To simplify their use, a short ID of the first 12 characters can be used on the command line. There is a small possibility of short id collisions, so the docker server will always return the long ID. [参考] 1. http://docs.docker.com/terms/image/
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/86061.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!