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。