SELinux导致的docker启动失败
安装docker
yum install -y 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.
查看状态
[root@c7 ~]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2019-01-14 03:00:04 EST; 12min ago
Docs: http://docs.docker.com
Main PID: 32274 (code=exited, status=1/FAILURE)
Jan 14 03:00:02 c7 systemd[1]: Starting Docker Application Container Engine...
Jan 14 03:00:02 c7 dockerd-current[32274]: time="2019-01-14T03:00:02.657456891-05:00" level=warning msg="could not change gr... found"
Jan 14 03:00:02 c7 dockerd-current[32274]: time="2019-01-14T03:00:02.673696729-05:00" level=info msg="libcontainerd: new con... 32279"
Jan 14 03:00:03 c7 dockerd-current[32274]: time="2019-01-14T03:00:03.765033141-05:00" level=warning msg="overlay2: the backing xfs ...
Jan 14 03:00:04 c7 dockerd-current[32274]: Error starting daemon: SELinux is not supported with the overlay2 graph driver on...=false)
Jan 14 03:00:04 c7 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Jan 14 03:00:04 c7 systemd[1]: Failed to start Docker Application Container Engine.
Jan 14 03:00:04 c7 systemd[1]: Unit docker.service entered failed state.
Jan 14 03:00:04 c7 systemd[1]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
错误信息
Jan 14 03:00:04 c7 dockerd-current[32274]: Error starting daemon: SELinux is not supported with the overlay2 graph driver on...=false)
所以错误是SELinux导致的。
解决方案
修改配置文件,将selinux-enabled改为selinux-enabled=false
vi /etc/sysconfig/docker
# /etc/sysconfig/docker
# Modify these options if you want to change the way the docker daemon runs
OPTIONS='--selinux-enabled=false --log-driver=journald --signature-verification=false'
if [ -z "${DOCKER_CERT_PATH}" ]; then
DOCKER_CERT_PATH=/etc/docker
fi
#其他省略
再次启动docker即可。