在使用systemctl start docker启动失败时,使用systemctl status docker.service.报告如下:
root@localhost ~]# 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 Wed 2018-07-25 00:24:56
EDT; 2min 4s ago
Docs: http://docs.docker.com
Main PID: 2600 (code=exited, status=1/FAILURE)
Jul 25 00:24:54 localhost.localdomain systemd[1]: Starting Docker...
Jul 25 00:24:54 localhost.localdomain dockerd-current[2600]: time...
Jul 25 00:24:54 localhost.localdomain dockerd-current[2600]: time...
Jul 25 00:24:55 localhost.localdomain dockerd-current[2600]: time...
Jul 25 00:24:56 localhost.localdomain dockerd-current[2600]: Erro...
Jul 25 00:24:56 localhost.localdomain systemd[1]: docker.service:...
Jul 25 00:24:56 localhost.localdomain systemd[1]: Failed to start...
Jul 25 00:24:56 localhost.localdomain systemd[1]: Unit docker.ser...
Jul 25 00:24:56 localhost.localdomain systemd[1]: docker.service ...
Hint: Some lines were ellipsized, use -l to show in full.
查资料得知:这里是linux的内核中的SELinux不支持 overlay2 graph driver ,解决方法有两个,要么启动一个新内核,要么就在docker里禁用selinux,–selinux-enabled=false
vi /etc/sysconfig/docker
然后systemctl start docker,问题解决