service docker start fails (daemon is not a docker command)

Viewed 2008

I have a problem after I have tried to restart docker. Since then, service docker start returns "start: Job failed to start".

This may have started once I have changed docker.conf. I have tried to reupload it using the command

wget -O /etc/init/docker.conf https://raw.githubusercontent.com/docker/docker/master/contrib/init/upstart/docker.conf

however, I was not lucky to fix this.

cat /var/log/upstart/docker.log returns:

Waiting for /var/run/docker.sock
docker: 'daemon' is not a docker command. See 'docker --help'.
Waiting for /var/run/docker.sock
docker: 'daemon' is not a docker command. See 'docker --help'.
Waiting for /var/run/docker.sock
docker: 'daemon' is not a docker command. See 'docker --help'.

Any help would be really appreciated.

2 Answers

In my case, after upgrade to docker 19.03.5, I got this error. When starting manually the /usr/bin/dockerd all works but via systemctl start docker it fails.

Looking at journalctl -xe I found the log:

docker: 'daemon' is not a docker command.

But the docker.service file was right, starting /usr/bin/dockerd.

I spent a time to figure out that the previous installation had a configuration file in: /etc/systemd/system/docker.service.d/override.conf that replace the docker daemon start command(/usr/bin/dockerd) with other deprecated syntax.

In this case you can remove the override.conf file to allow docker start:

rm /etc/systemd/system/docker.service.d/override.conf
systemctl daemon-reload
systemctl start docker

Hope it helps

Related