UnionFS(联合文件系统):Union文件系统是一种分层,轻量级并且高性的文件系统,它支持对文件系统的修改作为一次提交来一层层的叠加,同时可以将不同目录挂载到同一个虚拟文件系统下(unite several directories into a single virtual filesystem)。Union文件系统是Docker镜像的基础。 镜像可以通过分层来进行继承,基于基础镜像(没有父镜像),可以制作各种具体的应用镜像
## 安装,使用后;commit新镜像 [root@CentOs7_001 ubuntu]# docker commit -m="add a vim cmd" -a="igsshan" 41b2236cc927 igsshan/ubuntu:0.0.2
[root@CentOs7_001 ubuntu]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE igsshan/ubuntu 0.0.2 2a0da7b9e07a 5 seconds ago 184MB igsshan/ubuntu 0.0.1 df481e243482 6 hours ago 72.8MB ubuntu latest ba6acccedd29 19 months ago 72.8MB
[root@CentOs7_001 ubuntu]# docker run -it 2a0da7b9e07a /bin/bash root@52ce2750292b:/# vim a.txt root@52ce2750292b:/# cat a.txt this is ubuntu system ...
update file now ...
[root@CentOs7_001 ubuntu]# docker run -it ba6acccedd29 /bin/bash root@30e055106c2b:/# vim a.txt bash: vim: command not found ### 原始镜像重启新的容器,vim还是没有的 ### 自己commit构建的镜像,新增加了vim功能,可以成功使用