赞
踩
我们现在来启动一个镜像
$ docker run --name webnginx -d -p 80:80 nginx
-p
:表示将容器内的80端口映射到物理机的80端口-d
:后台运行docker进入容器更改nginx配置文件
- $ docker exec -it webnginx bash
- $ root@b5c597a4f124:/# echo '<h1>HELLO DOCKER<h1/>' > /usr/share/nginx/html/index.html
- $ docker restart webnginx
/usr/share/nginx/html/index.html
文件,这就会造成现在的镜像和之前的镜像的存储层已经发生了改变,docker也可以检测到这个更改docker 检测差异
- [qidai@qidai-pc ~]$ docker diff webnginx
- C /run
- A /run/nginx.pid
- C /usr
- C /usr/share
- C /usr/share/nginx
- C /usr/share/nginx/html
- C /usr/share/nginx/html/index.html
- C /var
- C /var/cache
- C /var/cache/nginx
- A /var/cache/nginx/client_temp
- A /var/cache/nginx/fastcgi_temp
- A /var/cache/nginx/proxy_temp
- A /var/cache/nginx/scgi_temp
- A /var/cache/nginx/uwsgi_temp
- C /root
- A /root/.bash_history
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。