Docker联合文件系统

摘录几篇比较好的参考文档:

1.Docker 联合文件系统(Union Filesystem): https://www.jianshu.com/p/5ec3d4dbf580

2.Visualizing Docker Containers and Images: http://merrigrove.blogspot.com/2015/10/visualizing-docker-containers-and-images.html

3.About storage drivers: https://docs.docker.com/storage/storagedriver/

摘录自参考文档一

假设Dockerfile 内容如下
FROM ubuntu:14.04
ADD run.sh /
VOLUME /data
CMD ["./run.sh"]
联合文件系统对应的层次结构如下图所示

摘录自参考文档二

镜像(Images):

The first visual I present is that of an image, shown below with two different visuals.  It is defined as the "union view" of a stack of read-only layers.

 

一层一层的只读层,代表本层和下面层的diff,若本层有文件系统的改动,则Read Layer包含具体改动后的文件,若没有文件系统的改动(比如仅仅只是增加了环境变量等),会记录到Meta Json中。

镜像层是存储在主机文件系统中的,针对aufs这种类型的文件系统驱动,可以去查看/var/lib/docker/aufs下的目录结构

sudo tree -L 1 /var/lib/docker/
/var/lib/docker/
├── aufs
├── containers
├── graph
├── init
├── linkgraph.db
├── repositories-aufs
├── tmp
├── trust
└── volumes
Finally, to tie up some loose ends, we should define an image layer. The below image shows an image layer and makes us realize that a layer is not just the changes to the file system.
 
The metadata is additional information about the layer that allows docker to capture runtime and build-time information, but also hierarchical information on a layer's parent. Both read and read-write layers contain this metadata.

 

 容器(Container):

A container is defined as a "union view" of a stack of layers the top of which is a read-write layer.

运行中的容器(Running Container):

 A running container is defined as a read-write "union view" and the the isolated process-space and processes within.  The below visual shows the read-write container surrounded by this process-space.

 

转载于:https://www.cnblogs.com/int80/p/10695280.html

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值