赞
踩
在虚拟机yum安装docker之后,执行docker命令时报错:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
然后启动docker时:
service docker start
报错:
Redirecting to /bin/systemctl start docker.service
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
systemctl status docker.service
其中有一条报错信息:
Error starting daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid
启动守护程序时出错:找到pid文件,请确保docker未运行或删除/var/run/docker.pid
经过各种百度搜索及修改,再执行
systemctl status docker.service
的时候,报错变成
Error starting daemon: SELinux is not supported with the overlay2 graph driver on this kernel. E...d=false)
大概意思是:此linux的内核中的SELinux不支持 overlay2 graph driver ,
解决方法有两个,要么启动一个新内核,要么就在docker里禁用selinux,
可以重新编译/etc/sysconfig/docker配置文件将–selinux-enabled改成–selinux-enabled=false
# Modify these options if you want to change the way the docker daemon runs
OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false'
if [ -z "${DOCKER_CERT_PATH}" ]; then
DOCKER_CERT_PATH=/etc/docker
fi
改完后
# 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命令即可正确运行
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。