SELinux 引起的docker启动失败

问题描述:

有一台使用中的docker突然发生了故障,然后启动docker失败。

机器的系统版本:CentOS Linux release 7.3.1611 (Core)

最后将这台机器的docker卸载后重装,但是docker还是起不来,启动docker报“Error starting daemon: SELinux is not supported with the overlay2 graph driver on this kernel.”的错误。具体的报错信息如下:

[[email protected] lib]# 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.
[[email protected] lib]# 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 Fri 2018-06-22 15:22:45 CST; 10s ago
     Docs: http://docs.docker.com
  Process: 6374 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: 6374 (code=exited, status=1/FAILURE)

Jun 22 15:22:42 registry.sefon.com systemd[1]: Starting Docker Application Container Engine...
Jun 22 15:22:42 registry.sefon.com dockerd-current[6374]: time="2018-06-22T15:22:42.987932115+08:00" level=info msg="libcontainerd: new containerd process, pid: 6381"
Jun 22 15:22:45 registry.sefon.com dockerd-current[6374]: Error starting daemon: SELinux is not supported with the overlay2 graph driver on this kernel. Either boot into a newer kernel or disabl...nabled=false)         #关键报错信息
Jun 22 15:22:45 registry.sefon.com systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Jun 22 15:22:45 registry.sefon.com systemd[1]: Failed to start Docker Application Container Engine.
Jun 22 15:22:45 registry.sefon.com systemd[1]: Unit docker.service entered failed state.
Jun 22 15:22:45 registry.sefon.com systemd[1]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

原因分析:

根据报错信息“Error starting daemon: SELinux is not supported with the overlay2 graph driver on this kernel. Either boot into a newer kernel or disabl...nabled=false)”的提示,这台机器的linux的内核中的SELinux不支持 overlay2 graph driver 。
解决方法有两个,要么启动一个新内核,要么就在docker配置文件里面里禁用selinux,--selinux-enabled=false

解决方法:

没有启动新的内核,修改的docker配置文件。将配置文件的“--selinux-enabled”改成“--selinux-enabled=false”,然后再重启docker。

[[email protected] lib]# cat /etc/sysconfig/docker
# /etc/sysconfig/docker

# Modify these options if you want to change the way the docker daemon runs
#OPTIONS=‘--selinux-enabled --log-driver=journald --signature-verification=false‘

OPTIONS=‘--selinux-enabled=false --log-driver=journald --signature-verification=false --registry-mirror=https://fzhifedh.mirror.aliyuncs.com --insecure-registry=registry.sese.com‘    #修改这里的"--selinux-enabled",改成"--selinux-enabled=false"
if [ -z "${DOCKER_CERT_PATH}" ]; then
    DOCKER_CERT_PATH=/etc/docker
fi

......   #配置文件后面的内容省略
[[email protected] lib]# 

然后重新启动docker,就正常启动了:

[[email protected] lib]# systemctl start docker
[[email protected] lib]# docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAME

[[email protected] lib]# 

解决方法参考文档:https://www.cnblogs.com/weifeng1463/p/9040892.html

原文地址:http://blog.51cto.com/10950710/2131803

时间: 2024-11-08 20:43:07

SELinux 引起的docker启动失败的相关文章

docker 启动失败

问题 docker 启动服务失败 场景 在Ubuntu中,将docker切换阿里镜像后,运行如下两条命令: sudo systemctl daemon-reload sudo systemctl restart docker 在重启docker服务这,报错信息如下: Job for docker.service failed because the control process exited with error code. See "systemctl status docker.servi

docker启动失败问题

内核3.10,systemctl start docker 被阻塞,没有返回,查看状态为启动中. 某兄弟机器安装docker之后,发现systemctl start docker的时候阻塞,由于排查走了一些弯路,记录如下: level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"level=info msg="libcontainerd:

docker启动失败

启动 docker 映射到宿主机时出现如下错误时:/usr/bin/docker-current: Error response from daemon: driver failed programming external connectivity on endpoint sc_mysql (1bc03030afe9f722ae1e6b46166172a70cf87bcc3f02f0acdac0be2a7f0f0036): (iptables failed: iptables --wait -

Docker 启动失败Starting docker (via systemctl): Job for docker.service failed

Starting docker (via systemctl):  Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.[FAILED] 解决办法: yum install device-mapper-devel fixed this for me. Using the default configuration of the latest do

CentOS7安装docker启动报错

执行yum install docker -y 命令安装docker 然后启动服务 systemctl start docker,服务启动失败 查询日志文件/var/log/messages,显示报错:Error starting daemon: SELinux is not supported with the overlay2 graph driver on this kernel. 问题原因:此linux的内核中的SELinux不支持 overlay2 graph driver 解决办法:

kvm虚拟机启动失败

1,环境:centos 6.5宿主机重启侯kvm虚拟机不能起来, 2,原因分析: 由于kvm所在的机器启用了SELINUX,后来将之关闭,关闭之后,发现kvm的虚拟机无法启动,启动过程中的报错信息如下: 1 2 3 [[email protected] ~]# virsh start zabbix error: Failed to start domain zabbix error: unsupported configuration: Unable to find security drive

rac某节点asm磁盘启动失败故障定位及恢复

RAC环境: oracle数据库:oracle11gr2 操作系统:rhel6.4_x86_64 故障现象: 1.rac其一个节点的oracle与asm相关的进程和实例启动失败: 查看方法:ps -ef|grep ora_ ps -ef|grep asm_ crsctl stat res -t (只能看到节点1上启动的oracle实例和asm实例) 2.在节点2上查看不到asm磁盘设备标签: 查看方法:oracleasm listdisks  (没有内容) ll /dev/oracleasm/d

Starting nginx: nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied) nginx 启动失败

Starting nginx: nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied) nginx 启动失败,日志里面报错信息如下: Starting nginx: nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied) 权限拒绝,经检查发现是开启selinux 导致的. 直接关闭 getenforce   这个命令可以查看当前是否开

Mysql学习之--Mysql启动失败案例

Mysql学习之--Mysql启动失败案例 系统环境: 操作系统:Linux RH6 数据库:  Mysql 5.6 在启动mysql server时,启动失败 [[email protected] mysql]# service mysql start Starting MySQL...The server quit without updating PID file [FAILED]b/mysql/ogg.pid). 查看mysql错误日志: [[email protected] mysql