Can't start docker on Ubuntu 16.04 with driver not supported error
Tried to run recently installed docker on Ubuntu 16.04
systemctl status docker.service
Got error:
level=info msg="libcontainerd: new containerd process, pid: 11293"
level=error msg="[graphdriver] prior storage driver \"aufs\" failed: driver not supported"
level=fatal msg="Error starting daemon: error initializing graphdriver: driver not supported"
Tried to install image-extras:
$ sudo apt-get -y install linux-image-extra-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-image-extra-4.4.19-040419-generic
E: Couldn't find any package by glob 'linux-image-extra-4.4.19-040419-generic'
E: Couldn't find any package by regex 'linux-image-extra-4.4.19-040419-generic'
Solution 1:
Apparently removing the folder isn't the best course of action because you are deleting any containers you had running. The better course of action is installing the linux-image-extras package that corresponds with your current kernel.
sudo apt-get update
sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
sudo modprobe aufs
sudo service docker restart
See https://mymemorysucks.wordpress.com/2016/03/31/docker-graphdriver-and-aufs-failed-driver-not-supported-error-after-ubuntu-upgrade/
Solution 2:
I did some research and I found the answer, I was able to fix the issue by using the overlay2 as storage driver, I followed the below link for that: https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/
Below step I took to fix the issue: Stop Docker.
$ sudo systemctl stop docker Copy the contents of /var/lib/docker to a temporary location.
$ cp -au /var/lib/docker /var/lib/docker.bk
Edit /etc/docker/daemon.json. If it does not yet exist, create it. Assuming that the file was empty, add the following contents.
{ "storage-driver": "overlay2" }
Start Docker.
$ sudo systemctl start docker
Verify that the daemon is using the overlay/overlay2 storage driver. $ sudo docker info
After this I was able to run docker container on my "16.04.2 LTS (Xenial Xerus)" sudo docker run -dit ubuntu
Docker CE
For Docker CE, only some configurations are tested, and your operating system’s kernel may not support every storage driver. In general, the following configurations work on recent versions of the Linux distribution:
Linux distribution Supported storage drivers Docker CE on Ubuntu aufs, devicemapper, overlay2 (Ubuntu 14.04.4 or later, 16.04 or later), overlay, zfs
https://github.com/moby/moby/issues/24023
Solution 3:
The problem is that aufs is not supported on kernel 4.0.x
Apparently removing aufs from docker:
sudo rm -rf /var/lib/docker/aufs
resolves the issue.
WARNING!
As @dragon788 mentioned in comment below, this will delete all existing AUFS containers.
Source and big thanks to: https://github.com/docker/docker/issues/14026#issuecomment-128055691
Solution 4:
Depending on your kernel version, you can switch to overlay
or overlay2
. Check your kernel version with uname -a
:
-
>= 3.18
: useoverlay
-
>= 4.0
: alsooverlay2
should be supported
Just update your storage driver in /etc/default/docker
with something like:
OPTIONS=" --storage-driver=overlay2"
and restart Docker service.