What exactly does Docker do with Union File system (like AUFS) to create the containers ? If Docker had to use a regular file system instead of a union file system what will be the disadvantages ?
I am looking for specific technical details/internals and not a high level answer.
It allows files and directories of separate file systems, known as branches, to be transparently overlaid, forming a single coherent file system. Contents of directories which have the same path within the merged branches will be seen together in a single merged directory, within the new, virtual filesystem.
AUFS is a union filesystem, which means that it layers multiple directories on a single Linux host and presents them as a single directory. These directories are called branches in AUFS terminology, and layers in Docker terminology. The unification process is referred to as a union mount.
Docker containers make use of the Union File System (UFS), which works with a series of read-only layers that includes a final read-write layer on top. This system functions perfectly when a container doesn't need to save data.
Overlay filesystems (also called union filesystems) is a fundamental technology in Docker to create images and containers. They allow creating a union of directories to create a filesystem.
It is used to:
That UnionFS:
implements a union mount for other file systems. It allows files and directories of separate file systems, known as branches, to be transparently overlaid, forming a single coherent file system.
Contents of directories which have the same path within the merged branches will be seen together in a single merged directory, within the new, virtual filesystem.This allows a file system to appear as writable, but without actually allowing writes to change the file system, also known as copy-on-write
If you didn't have UnionFS, an 200MB image run 5 times as 5 separates containers would mean 1GB of disk space.
See more at "How does a Docker image work?".
For more technical details, see:
jpetazzo
).If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With