Using Overlay file system with Docker on Ubuntu
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.
3.18 Kernel
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:
cd /tmp/ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-vivid/linux-headers-3.18.0-031800-generic_3.18.0-031800.201412071935_amd64.deb wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-vivid/linux-headers-3.18.0-031800_3.18.0-031800.201412071935_all.deb wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-vivid/linux-image-3.18.0-031800-generic_3.18.0-031800.201412071935_amd64.deb 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.
3.19 Kernel
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
Docker bits
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. DOCKER_OPTS="-s overlay"
Restart the Docker service, and if all is well you should get the following output from ‘docker info’
$ sudo docker info Containers: 0 Images: 0 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 etc...
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.
Update
[1] Justin Cormack pointed me at this article ‘Another union filesystem approach‘
Filed under: Docker, howto | 16 Comments
Tags: Docker, howto, overlay, OverlayFS, Ubuntu
16 Responses to “Using Overlay file system with Docker on Ubuntu”
- 1 Nifty Things for Week Ending 27 March » Ramblings
- 2 I quadrupled the speed of our container test rig in a day | Weave Blog
- 3 Docker 101 | ITJUMPSTART
- 4 Upgrading Docker Redux | Chris Swan's Weblog
- 5 I Quadrupled the Speed of Our Container Test Rig in a Day | Weaveworks blog
- 6 Using Overlay file system with Docker on systemd Ubuntu (15.04+) | Chris Swan's Weblog
- 7 Using Overlay file system with Docker on systemd Ubuntu (14.10+) | Chris Swan's Weblog
Leave a Reply Cancel reply
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Subscribe
Search
Raspberry Pi Downloads
Top Posts
- Getting more from a British Gas UP2 Timer
- Howto - Factory Reset iLO 4 on HP Microserver Gen8
- Milo cancer diary part 4 - second setback
- Making an image file from an SD card on Windows
- Using Amazon EC2 as a web proxy
- Node-RED on WRTnode
- Retro Computing - TMS9995 on RC2014
- Review - GL.iNet GL-MT1300 Travel Router
- 5 6 7 Rs of Cloud Migration
- Review - Intel NUC DC53427HYE
-
Recent Posts
Recent Comments
andyjpb on Milo cancer diary part 3… J on Milo cancer diary part 2… ChrisB on Reversion marketing milam8m on Milo cancer diary part 1… andyjpb on Milo cancer diary part 1… Pinboard.in bookmarks
- 9 qualities of a successful CTO
- Chinese web giant Baidu backs RISC-V for the datacenter
- Comparing hobby PCB vendors
- Judge Decides Against Internet Archive
- 8 reasons why DARE failed
- Fix for dpkg errors when running apt-get in Docker BuildX multiplatform
- Kashyap Patel, MD, Sees Link Between COVID-19 and Cancer Progression, Calls for More Biomarker Testing
- Resetting the Python logger level
- 50 years of silence
- The Waluigi Effect (mega-post)
Twitter Updates
- RT @jobsworth: Bot-ulism: information poisoning by the actions of bots 6 hours ago
- RT @monkchips: i am interested in if, and how, you're using GraphQL. what you're using it for? new API creation? data access modernisation… 6 hours ago
- Monday #pupdate https://t.co/nJeVt5DigR 7 hours ago
- Nice that the sun is shining over the London skyline for #QConLondon https://t.co/J1EddCRDat 1 day ago
- RT @richard_littler: It's #AutismAcceptanceWeek. We don't *have* autism; we *are* autistic. If you're not autistic, you're allistic. The re… 1 day ago
Blogroll
- 451 CAOS Theory
- Adam Bosworth’s Weblog
- Andrew McAfee
- Behavioural Investing
- CapitalSCF
- Carpe Visum
- causticTech
- Charles Stross
- confused of calcutta
- Cory Doctorow
- Craig Murray
- Dan Creswell’s Weblog
- Dark Reading
- Dilbert Blog
- DJW
- Doc Searls
- Don Box’s Spoutlet
- Dopplr
- Eben Moglen
- Enhyper
- Financial Cryptography
- Fred Destin
- Freedom to Tinker
- Graham Glass, etc.
- Greg Matter
- Hugh Grant
- Internet Alchemy
- Invisible Things
- James Strachan’s Weblog
- John Merrells
- Jon Udel
- Justice League
- Kim Cameron
- Lambda the Ultimate – Programming Languages Weblog
- Light Blue Touchpaper
- Loosely Coupled weblog
- Luke Hutteman’s Weblog
- Marc Andreeson
- Nick Selby
- ongoing
- Otaku, Cedric’s weblog
- Park Paradigm
- Paul Graham
- Phil Becker
- Pi4Tech
- PJKtech
- Radovan Janecek: Nothing Impersonal
- rants
- Richard Monson-Haefel
- SAAS
- Schneier on Security
- Service Oriented Enterprise
- Simon Phipps’s Blog
- techno.blog(“Dion”)
- The BileBlog
- THE GRID BLOG
- Tim Oren’s Due Diligence
- timbl’s blog
- virtualization.info
- WebMink
- WebServices.org
- XKCD
Categories
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?
https://wiki.ubuntu.com/Kernel/LTSEnablementStack
“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