Neo
Neo

Reputation: 2226

Cannot start docker daemon in CentOS7

After executing systemctl start docker, I got:

Failed to start docker.service: Unit not found.

And this is the output for systemctl status docker -l:

[root@HP11012078 init.d]# systemctl status docker -l
● 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

Feb 09 17:04:35 HP11012078 docker[28152]: time="2017-02-09T17:04:35.104333869+08:00" level=warning msg="container 58a5c6ba6710240bb5b1fd79e4600b547cf4c882eb2ca85e15c59c1404106877 restart canceled"
Feb 09 17:04:35 HP11012078 docker[28152]: time="2017-02-09T17:04:35.113914527+08:00" level=warning msg="container d320ba5f02cdd8567893acfc62b6673a24b6c8a43ccb52342bb3470ff420230d restart canceled"
Feb 09 17:04:35 HP11012078 docker[28152]: time="2017-02-09T17:04:35.122613873+08:00" level=warning msg="container 4030daadb9481a1b96b7a5c614c8910a601f83f2dced8340f4ea4c3583e7e844 restart canceled"
Feb 09 17:04:45 HP11012078 docker[28152]: time="2017-02-09T17:04:45.002120051+08:00" level=info msg="Container c13f11ce792c477d9b663c6fdbcfe9694663f7843a40540c58922893f4b41247 failed to exit within 10 seconds of signal 15 - using the force"
Feb 09 17:04:45 HP11012078 docker[28152]: time="2017-02-09T17:04:45.002120421+08:00" level=info msg="Container 0457d15d8b0bc83458dd3eea0c0b84699465da9746defc2429db89e426dbfa75 failed to exit within 10 seconds of signal 15 - using the force"
Feb 09 17:04:45 HP11012078 docker[28152]: time="2017-02-09T17:04:45.002870012+08:00" level=warning msg="Cannot kill container c13f11ce792c477d9b663c6fdbcfe9694663f7843a40540c58922893f4b41247: rpc error: code = 2 desc = \"containerd: container not found\""
Feb 09 17:04:45 HP11012078 docker[28152]: time="2017-02-09T17:04:45.049505738+08:00" level=warning msg="container 0457d15d8b0bc83458dd3eea0c0b84699465da9746defc2429db89e426dbfa75 restart canceled"
Feb 09 17:04:45 HP11012078 docker[28152]: time="2017-02-09T17:04:45.173034929+08:00" level=error msg="Force shutdown daemon"
Feb 09 17:04:45 HP11012078 docker[28152]: time="2017-02-09T17:04:45+08:00" level=info msg="stopping containerd after receiving terminated"
Feb 09 17:04:46 HP11012078 systemd[1]: Stopped Docker Application Container Engine.

But I can start docker using docker daemon command. Help, please

Upvotes: 12

Views: 48212

Answers (5)

ImranRazaKhan
ImranRazaKhan

Reputation: 2297

I was facing same issue and I have to follow following guideline, I think default CE installation doesn't have dependencies

https://docs.docker.com/engine/install/centos/#install-from-a-package

Upvotes: 0

Erlend
Erlend

Reputation: 61

If you get this error when installing Docker on CentOS 8:

On CentOS 8.1 the podman-manpages are in conflict with docker-ce (podman is Red Hat's container engine, and which comes pre-installed as a replacement for Docker).

A simple solution is to uninstall podman if you don't need it:
sudo yum -y remove podman
https://github.com/containers/libpod/issues/4791

Then you can install Docker:
sudo dnf install docker-ce --nobest -y

and

sudo systemctl daemon-reload
sudo systemctl start docker
sudo systemctl enable docker

Upvotes: 6

James Kirkley
James Kirkley

Reputation: 31

I used the Docker install guide and received the same error when i tried to start docker (unit not found) I had to uninstall:

yum remove docker-ce-cli containerd.io

and reinstall using:

curl -sSL https://get.docker.com/ | sh

worked like a champ

Upvotes: 3

VonC
VonC

Reputation: 1323793

Simply try and install again docker, to see if the issue persists:

sudo yum install docker 

Then service docker start and docker info.

Upvotes: 9

Diepie
Diepie

Reputation: 782

To resolve this issue, one have to create a missing file: /usr/lib/systemd/system/docker.socket

[Unit]
Description=Docker Socket for the API
PartOf=docker.service

[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker

[Install]
WantedBy=sockets.target

Then run:

systemctl daemon-reload
systemctl start docker.socket
systemctl start docker

Then Docker will start. It looks like the install removes that file and doesn't replace it.

Upvotes: 14

Related Questions