yum安装docker报错:Job for docker.service failed because the control process exited with error code

本文详细介绍了在CentOS7系统中遇到的Docker启动失败问题,包括错误信息解析、原因分析及解决方案。通过修改Docker配置文件,禁用SELinux支持,成功解决了启动错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一. 检查Linux内核版本,CenterOS7安装docker要求内核版本在3.10以上:uname  -r

二. 使用yum命令安装:yum install docker

三. 启动Docker: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  查看详细的错误信息

 

● 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 2018-10-25 09:18:32 CST; 24s ago
     Docs: http://docs.docker.com
  Process: 12137 ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --init-path=/usr/libexec/docker/docker-init-current --seccomp-profile=/etc/docker/seccomp.json $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES (code=exited, status=1/FAILURE)
 Main PID: 12137 (code=exited, status=1/FAILURE)

Oct 25 09:18:31 localhost.localdomain systemd[1]: Starting Docker Application Container Engine...
Oct 25 09:18:31 localhost.localdomain dockerd-current[12137]: time="2018-10-25T09:18:31.425321071+08:00" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"
Oct 25 09:18:31 localhost.localdomain dockerd-current[12137]: time="2018-10-25T09:18:31.442651147+08:00" level=info msg="libcontainerd: new containerd process, pid: 12149"
Oct 25 09:18:32 localhost.localdomain dockerd-current[12137]: time="2018-10-25T09:18:32.466837796+08:00" level=warning msg="overlay2: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior. Reformat the filesystem with ftype...
Oct 25 09:18:32 localhost.localdomain dockerd-current[12137]: Error starting daemon: SELinux 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)
Oct 25 09:18:32 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Oct 25 09:18:32 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
Oct 25 09:18:32 localhost.localdomain systemd[1]: Unit docker.service entered failed state.
Oct 25 09:18:32 localhost.localdomain systemd[1]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

具体原因是:是由于docker不支持图像内核驱动,SELinux不支持这个内核上的OrthALA2图形驱动程序

解决方式:修改docker配置文件:vim  /etc/sysconfig/docker

 

把OPTIONS一行改为:OPTIONS='--selinux-enabled=false --log-driver=journald --signature-verification=false'

再启动:systemctl start docker 就可以了

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

IT管道工

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值