Docker service fails to start due to dependency

I have docker 20.10.6 & CentOS 7.5

-bash-4.2$ docker version
Client: Docker Engine - Community
 Version:           20.10.6
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        370c289
 Built:             Fri Apr  9 22:45:33 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

when I try to run the service with

sudo systemctl start docker

I get an error of

A dependency job for docker.service failed. See 'journalctl -xe' for details.

systemctl returns this

systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/etc/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: https://docs.docker.com

I am following the guide from https://docs.docker.com/engine/install/centos/ I have tried reinstalling docker & dependencies, tried creating a /etc/docker/daemon.json file with the contents

{
  "storage-driver": "overlay2"
}

but no success

The command

export VERSION_STRING=20.10.6
sudo yum install docker-ce-${VERSION_STRING} docker-ce-cli-${VERSION_STRING} containerd.io

indicates no missing dependency

The logs in journalctl are not very informative:

sudo journalctl -fu docker
-- Logs begin at .... --
Dependency failed for Docker Application Container Engine.
 systemd[1]: Job docker.service/start failed with result 'dependency'.
 systemd[1]: Dependency failed for Docker Application Container Engine.
 systemd[1]: Job docker.service/start failed with result 'dependency'.
 systemd[1]: Dependency failed for Docker Application Container Engine.
 systemd[1]: Job docker.service/start failed with result 'dependency'.
 systemd[1]: Dependency failed for Docker Application Container Engine.
 systemd[1]: Job docker.service/start failed with result 'dependency'.

Upvotes: 1

Views: 16615

Answers (2)

Taha Yousuf Ali
Taha Yousuf Ali

Reputation: 11

dockerd --debug (gives you more visibility regarding the issue). Simply check if docker.sock file exists, if it does, delete it, restart the docker and it should work fine. Follow below steps:

ls -l /var/run/docker.sock
rm -rf /var/run/docker.sock
systemctl restart docker

Check now by running systemctl status docker or docker ps

Upvotes: 0

The following made the trick

sudo /usr/bin/dockerd -H unix://

So I start the docker engine that way, and I can start running containers, etc.

Upvotes: 3

Related Questions