Docker storage after kernel upgrade
I recently upgraded my linux kernel to 4.9.75
, the latest 4.14
release gave me network related issues, on Ubuntu 16.04.2
after hearing about the Meltdown and Spectre security flaws and reading Greg Kroah-Hartmanโs blog.
Upgrading the kernel
$ cd /tmp/
$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.75/linux-headers-4.9.75-040975-generic_4.9.75-040975.201801051530_amd64.deb
$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.75/linux-image-4.9.75-040975-generic_4.9.75-040975.201801051530_amd64.deb
$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.75/linux-headers-4.9.75-040975_4.9.75-040975.201801051530_all.deb
$ sudo dpkg -i \*.deb
$ sudo update-grub
$ sudo reboot
Bob was my uncle until I had to get on with my daily development workflow which makes heavy use of docker. I got an error that pointed to storage driver \"aufs\" failed: driver not supported
.
After some digging, I found that for aufs
one has to install, depending on the distribution, linux-image-extra
. However, only the kernel version that ships with the distribution is officially supported. I then discovered that overlay2
is recommended for kernel v4.0 and higher.
Changing the storage driver
NOTE: You will lose access to all your current images and containers due to layers! Reverting your changes will make your old images and containers accessible again. You can use
$ docker save IMAGE:TAG > IMAGE.tar.gz
to save your current images, and
$ docker load < IMAGE.tar.gz
to import them on the new storage driver.
Stop docker
:
$ sudo systemctl stop docker
Edit the file /etc/docker/daemon.json
(create it if doesnโt exist) and add the following to the file:
{
"storage-driver": "overlay2"
}
Start docker
:
$ sudo systemctl start docker
Use docker info
to verify that the storage driver is being used:
$ docker info
...
Storage Driver: overlay2
...
Hope someone out there finds this helpful.
Leave a comment