本文转载自博客园作者:蜗牛coder,点击前往原文
本机环境是VMware Workstation上安装的CentOS7。然后下载Docker。
DOCKER启动失败Job for docker.service failed because the control process exited with error code. See “syste mctl status docker.service” and “journalctl -xe” for details.
[root@192 ~]# systemctl start docker
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 -l
[root@192 ~]# systemctl status docker.service -l
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor prese
t: disabled)
Active: failed (Result: exit-code) since Thu 2020-08-06 11:06:09 EDT; 1min 45s
ago
Docs: http://docs.docker.com
Process: 13914 ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/us
r/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt nat
ive.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-c
urrent --init-path=/usr/libexec/docker/docker-init-current --seccomp-profile=/etc
/docker/seccomp.json $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $AD
D_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES (code=exited, status=1/
FAILURE)
Main PID: 13914 (code=exited, status=1/FAILURE)
Aug 06 11:06:08 192.168.179.130 systemd[1]: Starting Docker Application Container
Engine...
Aug 06 11:06:08 192.168.179.130 dockerd-current[13914]: time="2020-08-06T11:06:08
.498501526-04:00" level=warning msg="could not change group /var/run/docker.sock
to docker: group docker not found"
Aug 06 11:06:08 192.168.179.130 dockerd-current[13914]: time="2020-08-06T11:06:08
.505441943-04:00" level=info msg="libcontainerd: new containerd process, pid: 139
21"
Aug 06 11:06:09 192.168.179.130 dockerd-current[13914]: time="2020-08-06T11:06:09
.533309487-04:00" level=warning msg="overlay2: the backing xfs filesystem is form
atted without d_type support, which leads to incorrect behavior. Reformat the fil
esystem with ftype=1 to enable d_type support. Running without d_type support wil
l no longer be supported in Docker 1.16."
Aug 06 11:06:09 192.168.179.130 dockerd-current[13914]: Error starting daemon: SE
Linux is not supported with the overlay2 graph driver on this kernel. Either boot
into a newer kernel or disable selinux in docker (--selinux-enabled=false)
Aug 06 11:06:09 192.168.179.130 systemd[1]: docker.service: main process exited,
code=exited, status=1/FAILURE
Aug 06 11:06:09 192.168.179.130 systemd[1]: Failed to start Docker Application Co
ntainer Engine.
Aug 06 11:06:09 192.168.179.130 systemd[1]: Unit docker.service entered failed st
ate.
Aug 06 11:06:09 192.168.179.130 systemd[1]: docker.service failed.
关键信息:在Error starting daemon后可以找到报错原因:SELinux is not supported with the overlay2 graph driver on this kernel.
分析原因:此linux的内核中的SELinux不支持 overlay2 graph driver。
解决步骤:
1、在命令窗口输入命令去重新编辑docker配置文件:
vi /etc/sysconfig/docker
2、键入 i 开始修改
--selinux-enabled=false
3、修改完成后按Esc,在键盘键入 :wq 后回车表示写入完毕并保存退出
4、重新启动docker
systemctl start docker
启动成功!
注: 此文章只为记录开发过程中的错误,学习,如发现侵权请私信删除