union filesystem
A filesystem that stacks several directories on top of each other and shows them as one.
In more detail
Docker builds a container root directory by stacking the read-only image layers with a writable layer on top; when two layers hold the same path, the higher one wins. On Linux this is done by OverlayFS through the overlay2 storage driver. Because layers are shared rather than copied, a hundred containers from one image do not need a hundred copies of it.
Related terms
- OverlayFS — The Linux union filesystem Docker uses to stack image layers into a container root directory.
- layer — One read-only slice of an image that records the files a single build step added, changed or deleted.
- writable layer — The thin layer on top of an image where a running container writes its changes.
- copy on write — A rule where a shared file is only copied at the moment someone changes it.
- storage driver — The part of the Docker daemon that decides how image layers and container writable layers are stored on disk.
Taught in
- Union Filesystems, Images And Writable Layers — Docker Architecture & Production Containers