CentOS7.0(1406)安装Docker后无法启动

1. 问题现象

从http://archive.kernel.org/centos-vault/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-DVD.iso下载的安装文件,使用vmware安装系统。

然后按照Get Docker CE for CentOS的说明安装Docker。当安装完成后,输入指令sudo systemctl start docker启动Docker服务,失败,提示如下:

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

输入指令sudo 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: start-limit) since Fri 2019-03-01 21:01:28 CST; 2min 19s ago
Docs: https://docs.docker.com
Process: 18605 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 18605 (code=exited, status=1/FAILURE)

Mar 01 21:01:26 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Mar 01 21:01:26 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
Mar 01 21:01:26 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
Mar 01 21:01:26 localhost.localdomain systemd[1]: docker.service failed.
Mar 01 21:01:28 localhost.localdomain systemd[1]: docker.service holdoff time over, scheduling restart.
Mar 01 21:01:28 localhost.localdomain systemd[1]: Stopped Docker Application Container Engine.
Mar 01 21:01:28 localhost.localdomain systemd[1]: start request repeated too quickly for docker.service
Mar 01 21:01:28 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
Mar 01 21:01:28 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
Mar 01 21:01:28 localhost.localdomain systemd[1]: docker.service failed.

2. 原因

在网上找了一下,有说是SELinux的问题,尝试了一下不行。后来无意中看到Get Docker CE for CentOS中有一段说明:

OS requirements
To install Docker CE, you need a maintained version of CentOS 7. Archived versions aren’t supported or tested.

呵呵,原来是最新的Docker不支持老版本的CentOS。

3. 解决方案 :升级内核

最简单的方式就是sudo yum -y update,需要下载1G左右的升级文件。
也可以只升级内核:sudo yum update -y kernel,只需要下载100M左右的升级文件。
内核升级完毕后,重启。然后重新启动Docker服务,成功。

你可能感兴趣的:(CentOS7.0(1406)安装Docker后无法启动)