首页 > 解决方案 > Docker.Service 无法在 Manjaro XFCE Linux 上启动

问题描述

我在让 docker 在 Manjaro XFCE 上运行时遇到问题。

我已经安装了它:

sudo pacman -Syu

sudo pacman -S docker

并尝试使用以下方式运行它:

sudo systemctl start docker.service

但它因此错误而失败:

Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

这是我得到的日志systemctl status docker.service

[nimbi@nimbi-manjaro ~]$ systemctl status docker.service
● docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Thu 2020-10-29 01:31:09 MST; 14min ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
    Process: 14837 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
   Main PID: 14837 (code=exited, status=1/FAILURE)

Oct 29 01:31:09 nimbi-manjaro systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Oct 29 01:31:09 nimbi-manjaro systemd[1]: Stopped Docker Application Container Engine.
Oct 29 01:31:09 nimbi-manjaro systemd[1]: docker.service: Start request repeated too quickly.
Oct 29 01:31:09 nimbi-manjaro systemd[1]: docker.service: Failed with result 'exit-code'.
Oct 29 01:31:09 nimbi-manjaro systemd[1]: Failed to start Docker Application Container Engine.

journalctl -xe显示了这一点:

░░ The job identifier is 4697.
Oct 29 01:31:09 nimbi-manjaro systemd[1]: docker.service: Start request repeated too quickly.
Oct 29 01:31:09 nimbi-manjaro systemd[1]: docker.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ The unit docker.service has entered the 'failed' state with result 'exit-code'.
Oct 29 01:31:09 nimbi-manjaro systemd[1]: Failed to start Docker Application Container Engine.
░░ Subject: A start job for unit docker.service has failed
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ A start job for unit docker.service has finished with a failure.
░░ 
░░ The job identifier is 4631 and the job result is failed.
Oct 29 01:31:09 nimbi-manjaro systemd[1]: docker.socket: Failed with result 'service-start-limit-hit'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ The unit docker.socket has entered the 'failed' state with result 'service-start-limit-hit'.
lines 1990-2012/2012 (END)

尝试手动运行它会响应:

[nimbi@nimbi-manjaro ~]$ /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
INFO[2020-10-29T01:53:00.526035448-07:00] Starting up                                  
dockerd needs to be started with root. To see how to run dockerd in rootless mode with unprivileged user, see the documentation
[nimbi@nimbi-manjaro ~]$ sudo /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
INFO[2020-10-29T01:53:08.550576442-07:00] Starting up                                  
failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd

有人知道怎么修这个东西吗?

我也尝试通过 AUR 包重新安装,但我遇到了完全相同的问题。

如果有帮助,我正在使用 Manjaro XFCE 20.1.2。

- -编辑 - -

我想我想通了...

我必须使用sudo systemctl enable docker.service然后键入reboot让它自动启动。

它现在正在运行。

这是我当前的systemctl status docker.service命令输出:

[nimbi@nimbi-manjaro ~]$ systemctl status docker.service
● docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor p>
     Active: active (running) since Thu 2020-10-29 02:09:12 MST; 3min 10s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 946 (dockerd)
      Tasks: 15
     Memory: 72.9M
     CGroup: /system.slice/docker.service
             └─946 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/cont>

Oct 29 02:09:10 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:10.29207978>
Oct 29 02:09:10 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:10.29210347>
Oct 29 02:09:10 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:10.36927019>
Oct 29 02:09:11 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:11.20664981>
Oct 29 02:09:11 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:11.50144324>
Oct 29 02:09:11 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:11.96303711>
Oct 29 02:09:11 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:11.96351080>
Oct 29 02:09:11 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:11.97714186>
Oct 29 02:09:12 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:12.58058471>
Oct 29 02:09:12 nimbi-manjaro systemd[1]: Started Docker Application Container

标签: linuxdockermanjaro

解决方案


推荐阅读