Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why use AUFS as the default Docker storage backend instead of devicemapper?

Tags:

docker

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?

like image 739
Markus Miller Avatar asked Jul 15 '14 17:07

Markus Miller


People also ask

Why is aufs not working in Docker?

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.

What is the backing filesystem in Docker?

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:

How does the Docker engine decide which storage driver to use?

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.

Can I modify the storage-driver in Docker Desktop for Mac?

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.


2 Answers

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.

like image 83
Ben Whaley Avatar answered Oct 16 '22 17:10

Ben Whaley


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".

Why using DeviceMapper for Discourse sucks

like image 45
Dan Dascalescu Avatar answered Oct 16 '22 16:10

Dan Dascalescu