无法在Ubuntu Xenial上安装Docker:invoke-rc.d:initscript docker,action“start”failed

时间:2018-04-22 22:51:48

标签: docker

我一直在尝试在Ubuntu 16.04上安装Docker,但它给我一个错误,我无法自行解决。

使用位于get.docker.com的安装脚本:

root@m2dcs44rnq:~# wget -qO- https://get.docker.com/ | sh
# Executing docker install script, commit: 92d5116
+ sh -c apt-get update -qq >/dev/null
+ sh -c apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -qq - >/dev/null
+ sh -c echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial edge" > /etc/apt/sources.list.d/docker.list
+ [ ubuntu = debian ]
+ sh -c apt-get update -qq >/dev/null
+ sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
invoke-rc.d: initscript docker, action "start" failed.
dpkg: error processing package docker-ce (--configure): subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

systemctl status docker.service的输出:

● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since Sun 2018-04-22 18:26:04 EDT; 24s ago
     Docs: https://docs.docker.com
  Process: 13857 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
 Main PID: 13857 (code=exited, status=1/FAILURE)

Apr 22 18:26:04 m2dcs44rnq systemd[1]: Failed to start Docker Application Container Engine.
Apr 22 18:26:04 m2dcs44rnq systemd[1]: docker.service: Unit entered failed state.
Apr 22 18:26:04 m2dcs44rnq systemd[1]: docker.service: Failed with result 'exit-code'.
Apr 22 18:26:04 m2dcs44rnq systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Apr 22 18:26:04 m2dcs44rnq systemd[1]: Stopped Docker Application Container Engine.
Apr 22 18:26:04 m2dcs44rnq systemd[1]: docker.service: Start request repeated too quickly.
Apr 22 18:26:04 m2dcs44rnq systemd[1]: Failed to start Docker Application Container Engine.

journalctl -xe

-- Unit docker.socket has begun starting up.
Apr 22 18:47:58 m2dcs44rnq 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.
Apr 22 18:47:58 m2dcs44rnq systemd[1]: docker.service: Start request repeated to
Apr 22 18:47:58 m2dcs44rnq systemd[1]: Failed to start Docker Application Contai
-- 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.
Apr 22 18:47:58 m2dcs44rnq systemd[1]: docker.socket: Unit entered failed state.
Apr 22 18:47:59 m2dcs44rnq sshd[15811]: Failed password for invalid user backupp
Apr 22 18:48:00 m2dcs44rnq sshd[15811]: Received disconnect from 2.236.185.188 p
Apr 22 18:48:00 m2dcs44rnq sshd[15811]: Disconnected from 2.236.185.188 port 587
lines 1706-1728/1728 (END)
--
-- Unit docker.socket has begun starting up.
Apr 22 18:47:58 m2dcs44rnq 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.
Apr 22 18:47:58 m2dcs44rnq systemd[1]: docker.service: Start request repeated too quickly.
Apr 22 18:47:58 m2dcs44rnq 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.
Apr 22 18:47:58 m2dcs44rnq systemd[1]: docker.socket: Unit entered failed state.
Apr 22 18:47:59 m2dcs44rnq sshd[15811]: Failed password for invalid user backuppc from 2.236.185.188 port 58738 ssh2
Apr 22 18:48:00 m2dcs44rnq sshd[15811]: Received disconnect from 2.236.185.188 port 58738:11: Normal Shutdown, Thank you for playing [preauth]
Apr 22 18:48:00 m2dcs44rnq sshd[15811]: Disconnected from 2.236.185.188 port 58738 [preauth]

uname -a

Linux m2dcs44rnq 2.6.32-042stab127.2 #1 SMP Thu Jan 4 16:41:44 MSK 2018 x86_64 x86_64 x86_64 GNU/Linux

我已经尝试手动下载软件包并使用dkpg安装它,遗憾的是,这也给出了同样的错误。

2 个答案:

答案 0 :(得分:2)

经过一些研究并查看journalctl -u docker的日志后,我找到了以下内容:

Apr 21 18:12:41 m2dcs44rnq dockerd[18728]: time="2018-04-21T18:12:41.088984468-04:00" level=fatal msg="Your Linux kernel version 2.6.32-042stab127.2 is not supported for running docker. Please upgrade your kernel to 3.10.0 or newer."

事实证明我的内核不支持Docker。我的坏。

答案 1 :(得分:0)

就我而言,我的内核版本大于3.10.0。但是,看来,较旧安装的残留物阻止了我的安装。因此,在重新安装之前,我必须先删除,清除然后删除以下内容。 / usr / lib / docker / /etc/docker.service.d /