请教下centos7启动docker异常?


启动docker

service docker start

Starting docker (via systemctl):

Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.

按提示敲systemctl status docker.service

systemctl status docker.service

docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled)
Active: failed (Result: timeout) since Wed 2015-10-14 12:22:57 HKT; 20h ago
Docs: https://docs.docker.com
Main PID: 15618
CGroup: /system.slice/docker.service

Oct 14 12:21:27 centos7-linux--wd.shared systemd: Starting Docker Application Container Engine...
Oct 14 12:21:28 centos7-linux--wd.shared docker: time="2015-10-14T12:21:28.122825966+08:00" level=info msg=" using prior sto...pper\""
Oct 14 12:21:28 centos7-linux--wd.shared docker: time="2015-10-14T12:21:28.126233627+08:00" level=info msg="Option DefaultDriver: bridge"
Oct 14 12:21:28 centos7-linux--wd.shared docker: time="2015-10-14T12:21:28.126274740+08:00" level=info msg="Option DefaultNetwork: bridge"
Oct 14 12:21:28 centos7-linux--wd.shared docker: time="2015-10-14T12:21:28.130986465+08:00" level=warning msg="Running modprobe bridge nf...atus 1"
Oct 14 12:22:57 centos7-linux--wd.shared systemd: docker.service operation timed out. Terminating.
Oct 14 12:22:57 centos7-linux--wd.shared systemd: Failed to start Docker Application Container Engine.
Oct 14 12:22:57 centos7-linux--wd.shared systemd: Unit docker.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.

加粗文字
已邀请:

tuxknight

赞同来自: OhMyDock


提供的信息比较少,,你自己看看这个case吧。https://github.com/docker/docker/issues/15498

刘钧

赞同来自: OhMyDock


可能和Selinux冲突,禁用Selinux一下试试。

OhMyDock - docker白

赞同来自:


记录下解决方法,感谢@刘钧

查看SELinux状态:
1、/usr/sbin/sestatus -v <span style="font-size:16px">如果SELinux status参数为enabled即为开启状态</span>
SELinux status: enabled
2、getenforce <span style="font-size:16px">也可以用这个命令检查</span>
关闭SELinux:
1、临时关闭(不用重启机器):
setenforce 0 <span style="font-size:16px">设置SELinux 成为permissive模式</span>
<span style="font-size:16px">setenforce 1 设置SELinux 成为enforcing模式</span>
2、修改配置文件需要重启机器:
修改/etc/selinux/config 文件
将SELINUX=enforcing改为SELINUX=disabled
重启机器即可

参考:http://bguncle.blog.51cto.com/3184079/957315

OhMyDock - docker白

赞同来自:


虽然关闭了selinux,但是貌似执行docker 还是会出现下面错误:

docker images

Get http:///var/run/docker.sock/v1.20/images/json: dial unix /var/run/docker.sock: no such file or directory.
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?

重启docker服务,就正常了。

要回复问题请先登录注册