将selinux状态设置为“允许”,仍然无法运行docker

将selinux状态设置为“允许”,仍然无法运行docker,docker,Docker,安装docker后,我已将selinux状态设置为“允许”,仍然无法运行docker 在我的/etc/selinux/config中,我编辑了selinux=disabled 和设置强制执行0,请检查: # getenforce Permissive 我使用了systemctl启动docker,但失败,出现以下错误: # systemctl status docker.service ● docker.service - Docker Application Container Engine

安装docker后,我已将selinux状态设置为“允许”,仍然无法运行docker

在我的
/etc/selinux/config
中,我编辑了
selinux=disabled

设置强制执行0
,请检查:

# getenforce
Permissive 
我使用了
systemctl启动docker
,但失败,出现以下错误:

# 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 五 2018-06-29 09:05:47 CST; 14s ago
     Docs: http://docs.docker.com
  Process: 21615 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: 21615 (code=exited, status=1/FAILURE)

6月 29 09:05:46 123.xyz systemd[1]: Starting Docker Application Container Engine...
6月 29 09:05:46 123.xyz dockerd-current[21615]: time="2018-06-29T09:05:46.451911058+08:00" level=warning msg="could not ch...found"
6月 29 09:05:46 123.xyz dockerd-current[21615]: time="2018-06-29T09:05:46.453472267+08:00" level=info msg="libcontainerd: ...21626"
6月 29 09:05:47 123.xyz dockerd-current[21615]: time="2018-06-29T09:05:47.463085812+08:00" level=warning msg="overlay2: the back...
6月 29 09:05:47 123.xyz dockerd-current[21615]: Error starting daemon: SELinux is not supported with the overlay2 graph dr...false)
6月 29 09:05:47 123.xyz systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
6月 29 09:05:47 123.xyz systemd[1]: Failed to start Docker Application Container Engine.
6月 29 09:05:47 123.xyz systemd[1]: Unit docker.service entered failed state.
6月 29 09:05:47 123.xyz systemd[1]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
为什么还有人说:

启动守护程序时出错:覆盖图2不支持SELinux(dr…false)

我的linux是CentOS 7.2,我找到了解决方案

/etc/sysconfig/docker
中:

OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false'
if [ -z "${DOCKER_CERT_PATH}" ]; then
    DOCKER_CERT_PATH=/etc/docker
fi
-selinux-enabled
设置为
-selinux-enabled=false

我找到了解决方案

/etc/sysconfig/docker
中:

OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false'
if [ -z "${DOCKER_CERT_PATH}" ]; then
    DOCKER_CERT_PATH=/etc/docker
fi
-selinux-enabled
设置为
--selinux-enabled=false