docker_practice/underly/ufs.md

11 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

## Union文件系统
Union文件系统[UnionFS](http://en.wikipedia.org/wiki/UnionFS))是一种分层、轻量级并且高性能的文件系统,它支持对文件系统的修改作为一次提交来一层层的叠加,同时可以将不同目录挂载到同一个虚拟文件系统下(unite several directories into a single virtual filesystem)。
Union文件系统是Docker镜像的基础。镜像可以通过分层来进行继承基于基础镜像没有父镜像可以制作各种具体的应用镜像。
另外不同Docker容器就可以共享一些基础的文件系统层同时再加上自己独有的改动层大大提高了存储的效率。
Docker中使用的AUFSAnotherUnionFS就是一种 Union FS。 AUFS支持为每一个成员目录类似Git的分支设定只读readonly、读写readwrite和写出whiteout-able权限, 同时 AUFS 里有一个类似分层的概念, 对只读权限的分支可以逻辑上进行增量地修改(不影响只读部分的)。
Docker目前支持的Union文件系统种类包括AUFS, btrfs, vfs, 和DeviceMapper。