I tried to install docker on Ubuntu 20.04 with the following commands:
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo apt install docker-ce
The docker daemon does not startup and the error is this one:
failed to start daemon: error initializing graphdriver: devicemapper: Error running deviceCreate (CreatePool) dm_task_run failed
I tried changing the storage to overlay
but did not work
2
Answers
I found the issue. The OS was configured in a way that the load of kernel modules was disabled and docker was not able to
modprobe overlay
so it failed to start up.Go to the
/var/lib/docker
directory and check whether thedevicemapper
andoverlay2
directories exist at the same time. If they exist at the same time, delete thedevicemapper
directory and restart the docker service