web-dev-qa-db-fra.com

Impossible de démarrer le service Docker avec l'erreur "Impossible de démarrer docker.service: unité introuvable."

J'ai installé Docker avec yum install docker:

$ uname -a
Linux caspgval4 3.10.0-229.20.1.el7.x86_64 #1 SMP Wed Nov 4 10:08:36 CST 2015 x86_64 x86_64 x86_64 GNU/Linux

$ docker --version
Docker version 1.12.6, build 3a094bd/1.12.6

$ docker info
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

$ Sudo systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: http://docs.docker.com

J'essaie d'installer et d'exécuter Docker, mais cela donne une erreur comme ci-dessous:

$ Sudo service docker start
Redirecting to /bin/systemctl start  docker.service
Failed to start docker.service: Unit not found.

Comment résoudre ce problème? J'ai essayé les commandes suivantes, mais pas de chance:

$ Sudo systemctl start docker
Failed to start docker.service: Unit not found.

Informations supplémentaires:

$ journalctl -u docker
No journal files were found.
-- No entries --

$ cat /usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=network.target
Wants=docker-storage-setup.service
Requires=rhel-Push-plugin.socket
Requires=docker-cleanup.timer

[Service]
Type=notify
NotifyAccess=all
EnvironmentFile=-/etc/sysconfig/docker
EnvironmentFile=-/etc/sysconfig/docker-storage
EnvironmentFile=-/etc/sysconfig/docker-network
Environment=GOTRACEBACK=crash
Environment=DOCKER_HTTP_Host_COMPAT=1
Environment=PATH=/usr/libexec/docker:/usr/bin:/usr/sbin
ExecStart=/usr/bin/dockerd-current \
          --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current \
          --default-runtime=docker-runc \
          --authorization-plugin=rhel-Push-plugin \
          --exec-opt native.cgroupdriver=systemd \
          --userland-proxy-path=/usr/libexec/docker/docker-proxy-current \
          $OPTIONS \
          $DOCKER_STORAGE_OPTIONS \
          $DOCKER_NETWORK_OPTIONS \
          $ADD_REGISTRY \
          $BLOCK_REGISTRY \
          $INSECURE_REGISTRY
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
TimeoutStartSec=0
Restart=on-abnormal
MountFlags=slave

[Install]
WantedBy=multi-user.target

J'ai essayé ce qui suit:

$ Sudo systemctl daemon-reload
$ Sudo systemctl start docker
Failed to start docker.service: Unit not found.
$ Sudo journalctl -u docker
-- No entries --

Plus d'informations de débogage:

$ Sudo systemctl status network.target
● network.target - Network
   Loaded: loaded (/usr/lib/systemd/system/network.target; static; vendor preset: disabled)
   Active: active since Mon 2017-01-23 02:54:39 PST; 2 months 29 days ago
     Docs: man:systemd.special(7)
           http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget

Jan 23 02:54:39 mymachine systemd[1]: Starting Network.
Jan 23 02:54:39 mymachine systemd[1]: Reached target Network.

$ Sudo systemctl status docker-storage-setup.service
● docker-storage-setup.service - Docker Storage Setup
   Loaded: loaded (/usr/lib/systemd/system/docker-storage-setup.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

$ Sudo systemctl status rhel-Push-plugin.socket
Unit rhel-Push-plugin.socket could not be found.

$ Sudo systemctl status docker-cleanup.timer
● docker-cleanup.timer - Run docker-cleanup every hour
   Loaded: loaded (/usr/lib/systemd/system/docker-cleanup.timer; disabled; vendor preset: disabled)
   Active: inactive (dead)
6
user5154816

Il semble que vous manquez l'unité rhel-Push-plugin.socket qui fait vraisemblablement partie d'un package rhel-Push-plugin. Vous pouvez essayer de réparer cette installation, ou vous pouvez installer le package Docker en amont directement à partir de Docker avec les éléments suivants en tant que root:

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

L'installation Docker en amont sera une version plus récente de Docker, mais elle n'aura pas les diverses modifications RHEL comme le plugin rhel-Push.

10
BMitch