Last week Jérôme Petazzoni did an excellent (abbreviated) version of his ‘Deep dive into Docker storage drivers‘ at the London Docker Meetup. If I wasn’t convinced enough by that, Jessie Frazelle hammered home the same point in her QCon Presentation – AUFS is where it used to be at, and the new king is Overlay. I set about trying it out for myself during Jessie’s presentation, and as I couldn’t find a simple guide I’m writing one here.
Update 24 Dec 2015 If you’re using Ubuntu after the switch to systemd (14.10+) then you need these instructions.
OverlayFS has been in Ubuntu kernels for some time, but that’s not what we want. Overlay (without the FS) is a different kernel module, so you’ll need to install the 3.18 (or later) kernel:
sudo dpkg -i linux-headers-3.18.0-*.deb linux-image-3.18.0-*.deb
I’ve tested this myself on Ubuntu 14.04 and 12.04.
Thanks to Manbeard for pointing out that the release of 15.04 makes the kernel upgrade much easier:
sudo apt-get install -y –install-recommends linux-generic-lts-vivid
You’ll need Docker 1.4 or later (I tested on 1.5), which can be installed using the usual Ubuntu instructions if you don’t already have it.
After rebooting to get the new kernel it’s now necessary to set ‘-s overlay’ in the DOCKER_OPTS within /etc/default/docker:
# Use DOCKER_OPTS to modify the daemon startup options.
Restart the Docker service, and if all is well you should get the following output from ‘docker info’
$ sudo docker info
Storage Driver: overlay
Backing Filesystem: extfs
Execution Driver: native-0.2
Kernel Version: 3.18.0-031800-generic
Operating System: Ubuntu 14.04.1 LTS
I seem to recall needing ‘modprobe overlay’ on 12.04 to get things working. I’d also note the bad news that Docker falls back to DeviceMapper (rather than AUFS) if it can’t make Overlay work.
 Justin Cormack pointed me at this article ‘Another union filesystem approach‘
Why is overlay the “king” now?
Faster, more reliable, and it seems to be what the Docker core team are running on their own setups, so it’s likely the one that’s getting the most testing.
Probably the biggest plus for overlay is that it is in the Linux kernel proper as of 3.18. AUFS, on the other hand, was an out-of-tree kernel patchset, so each distro would have to evaluate if they would maintain it and put it into their kernel builds.
We have translated your article to chinese:http://dockerone.com/article/237
Please note that previous containers running with aufs will not be available to overlay. Plan accordingly.
Good point. I started using overlay on a new VM, but if you have existing containers then they will need to be exported and imported.
Couldn’t you just use the LTS kernel enablement to upgrade?
“sudo apt-get install –install-recommends linux-generic-lts-vivid”
Thanks – that wasn’t an option when I first wrote this, but now that 15.04 is out it’s a much easier way to go.
Thanks! Updated for Ubuntu 15.04 and systemd here: https://gist.github.com/rosskevin/6e693047e79f9c9d0702
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
You are commenting using your Google+ account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.
Default feed link
Subscribe in a reader