0

I want to install docker-ce,but it cannot launch

I install docker-ce in this way:

sudo yum install docker-ce

My system type:

Linux version 3.10.107-1-tlinux2_kvm_guest-0046 (root@TENCENT64.site) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP Wed Dec 27 10:57:04 CST 2017

docker version:

docker version
Client:
 Version:           18.09.7
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        2d0083d
 Built:             Thu Jun 27 17:56:06 2019
 OS/Arch:           linux/amd64
 Experimental:      false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

error info detail:

systemctl status docker.service
* docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/docker.service.d
           `-override.conf
   Active: failed (Result: start-limit) since Wed 2019-07-31 10:12:15 CST; 921ms ago
     Docs: https://docs.docker.com
  Process: 15961 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 15961 (code=exited, status=1/FAILURE)

Jul 31 10:12:13 TENCENT64.site systemd[1]: Failed to start Docker Application Container Engine.
Jul 31 10:12:13 TENCENT64.site systemd[1]: Unit docker.service entered failed state.
Jul 31 10:12:13 TENCENT64.site systemd[1]: docker.service failed.
Jul 31 10:12:15 TENCENT64.site systemd[1]: docker.service holdoff time over, scheduling restart.
Jul 31 10:12:15 TENCENT64.site systemd[1]: Stopped Docker Application Container Engine.
Jul 31 10:12:15 TENCENT64.site systemd[1]: start request repeated too quickly for docker.service
Jul 31 10:12:15 TENCENT64.site systemd[1]: Failed to start Docker Application Container Engine.
Jul 31 10:12:15 TENCENT64.site systemd[1]: Unit docker.service entered failed state.
Jul 31 10:12:15 TENCENT64.site systemd[1]: docker.service failed.
journalctl -xe
Jul 31 10:12:13 TENCENT64.site systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has failed.
-- 
-- The result is failed.
Jul 31 10:12:13 TENCENT64.site systemd[1]: Unit docker.service entered failed state.
Jul 31 10:12:13 TENCENT64.site systemd[1]: docker.service failed.
Jul 31 10:12:15 TENCENT64.site systemd[1]: docker.service holdoff time over, scheduling restart.
Jul 31 10:12:15 TENCENT64.site systemd[1]: Stopped Docker Application Container Engine.
-- Subject: Unit docker.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has finished shutting down.
Jul 31 10:12:15 TENCENT64.site systemd[1]: Closed Docker Socket for the API.
-- Subject: Unit docker.socket has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.socket has finished shutting down.
Jul 31 10:12:15 TENCENT64.site systemd[1]: Stopping Docker Socket for the API.
-- Subject: Unit docker.socket has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.socket has begun shutting down.
Jul 31 10:12:15 TENCENT64.site systemd[1]: Starting Docker Socket for the API.
-- Subject: Unit docker.socket has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.socket has begun starting up.
Jul 31 10:12:15 TENCENT64.site systemd[1]: Listening on Docker Socket for the API.
-- Subject: Unit docker.socket has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.socket has finished starting up.
-- 
-- The start-up result is done.
Jul 31 10:12:15 TENCENT64.site systemd[1]: start request repeated too quickly for docker.service
Jul 31 10:12:15 TENCENT64.site systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has failed.
-- 
-- The result is failed.
Jul 31 10:12:15 TENCENT64.site systemd[1]: Unit docker.service entered failed state.
Jul 31 10:12:15 TENCENT64.site systemd[1]: docker.service failed.

my daemon.json(/etc/docker/daemon.json)is not exist, when i create a daemon.json with its content '{}',also error

I have tried some ways:

  1. clear /var/lib/docker
  2. reinstall docker-ce

docker's old version docker and docker-io is normal,but it no ip and port mapping, so i use docker-ce now.

how to fix this question?

tgogos
  • 23,218
  • 20
  • 96
  • 128
Mori
  • 1
  • 1
  • 1
  • What about use `curl https://get.docker.com/ | sudo sh` to install? – atline Jul 31 '19 at 03:16
  • @atline you mean apart from running some unknown random commands found on the web with root privileges? – Henry Jul 31 '19 at 05:31
  • Did you follow the installation guide here: https://docs.docker.com/install/linux/docker-ce/centos/ ? Containerd might me missing .e.g. – Big X Jul 31 '19 at 07:13

1 Answers1

0

Docker can be started with two different methods :

  1. Via systemctl, which is the recommanded way
  2. Directly via the docker daemon bin : dockerd which is not the recommanded way

However, when you start the docker daemon directly (ie not with systemctl), systemctl has no way to know the current status of the daemon.

So my guess is that, after the install, the docker daemon was somehow partially started and failed.
To check if that's the case, just run :

sudo ps -aux | grep dockerd

Then kill all the process attached to the docker daemon.
When it is done, you should be able to start docker directly via systemctl.

Marc ABOUCHACRA
  • 3,155
  • 12
  • 19