Project Atomic's description of Docker storage backends describes technical differences between AUFS and other storage backend choices, such as devicemapper. AUFS is not in the upstream Linux kernel. Why is AUFS chosen as the default storage backend (for example in Ubuntu's Docker)? Are there some technical properties of AUFS that makes it a better choice than a storage backend such as devicemapper that seems to be supported by an unpatched Linux kernel?
AUFS cannot use the following backing filesystems: aufs, btrfs, or ecryptfs. This means that the filesystem which contains /var/lib/docker/aufs cannot be one of these filesystem types. If the AUFS driver is loaded into the kernel when you start Docker, and no other storage driver is configured, Docker uses it by default.
With regard to Docker, the backing filesystem is the filesystem where /var/lib/docker/ is located. Some storage drivers only work with specific backing filesystems. Among other things, each storage driver has its own performance characteristics that make it more or less suitable for different workloads. Consider the following generalizations:
The Docker Engine has a prioritized list of which storage driver to use if no storage driver is explicitly configured, assuming that the storage driver meets the prerequisites, and automatically selects a compatible storage driver. You can see the order in the source code for Docker Engine 20.10.
Modifying the storage-driver is not supported on Docker Desktop for Mac and Docker Desktop for Windows, and only the default storage driver can be used. The comparison table below is also not applicable for Rootless mode.
AUFS is only the default storage back end on systems/distributions that have it available. Otherwise, devicemapper is the default. Ubuntu 14.04, for example, defaults to devicemapper:
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"
$ docker info | grep Storage
Storage Driver: devicemapper
This changed in Docker 0.7.0. Prior to 0.7.0, Docker relied upon AUFS as its only storage driver, which is why it was the default in earlier versions of Ubuntu.
I'm far from an expert on filesystems, but the folks at Discourse, who are, strongly recommend using AUFS, and not DeviceMapper. Using DeviceMapper can result in "a world of pain".
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