Docker image layers rely on UnionFS implementations. Check the active driver with docker info (Storage Driver).
AUFS
AUFS was Docker’s first storage driver. It is the most battle-tested and widely used option alongside Overlay.
Main advantage: page sharing — if two containers load libraries or data from the same lower layer, the OS can map one memory page for both.
Main drawback: no in-kernel support on most distros, though Debian and Ubuntu have used it for years. AUFS works at the file level, so even a small change to a large file copies the entire file into the container’s read/write layer. BTRFS and devicemapper work at the block level and use disk space more efficiently for large files.
Good choice on Debian or Ubuntu hosts.
Overlay
Overlay is similar to AUFS. Kernel support appeared in Linux 3.18. It is likely to become the primary driver and should offer somewhat better performance than AUFS.
Downsides today: needs recent kernels (often with distro-specific patches) and is less thoroughly tested than AUFS.
devicemapper
Default on Red Hat systems. devicemapper is a kernel driver used for RAID, encryption, and snapshots. Docker uses its thin provisioning with block-level copy-on-write.
A thin pool is created from a sparse file (100 GB by default). Containers get a filesystem backed by that pool with a 100 GB limit (Docker 1.8 defaults). Sparse files use less real disk space, but the container cannot exceed the limit without changing defaults.
Many operators find devicemapper the hardest driver to run reliably. Prefer an alternative when possible. If you must use it, tune carefully — for example, move storage off the default loopback device onto a real block device.
BTRFS
BTRFS is a copy-on-write filesystem focused on crash resilience and very large files and volumes. Because of BTRFS-specific chunk behavior, only recommend it for teams that already run BTRFS or need features other drivers lack.
A good fit when containers read and write very large files and you want block-level support.
ZFS
ZFS is popular and in many ways similar to BTRFS, with strong claims around performance and reliability.
Running ZFS on Linux is non-trivial because licensing prevents mainline kernel inclusion. Only recommend it for organizations with substantial ZFS experience.
Related topics
- Images overview — how layers use UnionFS
- Storage — volumes and bind mounts
- Installation — change the storage driver at daemon start
Andrew Dorokhov