Facing the below error while starting docker with systemctl:
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
Below is the output if I cat form start service:
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2017-07-14 18:23:13 IST; 2min 4s ago
Docs: https://docs.docker.com
Process: 6325 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
Main PID: 6325 (code=exited, status=1/FAILURE)
Jul 14 18:23:12 iconlap02 systemd[1]: Starting Docker Application Container Engine...
Jul 14 18:23:12 iconlap02 dockerd[6325]: time="2017-07-14T18:23:12.415162784+05:30" level=info msg="libcontainerd: new containerd process, pid: 6333"
Jul 14 18:23:13 iconlap02 dockerd[6325]: Error starting daemon: error initializing graphdriver: /var/lib/docker contains several valid graphdrivers: aufs, overlay; Please cleanup or explicitly choose storage driver (-s <DRIVER>)
Jul 14 18:23:13 iconlap02 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Jul 14 18:23:13 iconlap02 systemd[1]: Failed to start Docker Application Container Engine.
Jul 14 18:23:13 iconlap02 systemd[1]: docker.service: Unit entered failed state.
Jul 14 18:23:13 iconlap02 systemd[1]: docker.service: Failed with result 'exit-code'.
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/
I took the followins steps 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 doesn't exist yet: 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
For Docker CE only some configurations are tested. 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With