解决Job for docker.service failed because the control process exited with error code. See "systemctl s
在ubuntu16.04下安装安装docker docker daemon启不起来,报如下错误:Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for det
在ubuntu16.04下安装安装docker docker daemon启不起来,报如下错误:
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
解决方法:
修改docker.service内容:
sudo vim /lib/systemd/system/docker.service
将
ExecStart=/usr/bin/dockerd -H fd:// 改成
ExecStart=/usr/bin/dockerd -H fd:// -s overlay2
然后执行:
sudo systemctl daemon-reload
sudo systemctl restart docker
成功启动docker
-------------------------------------------------------------------add on----------------------------------------------------------------------------
如果需要pull docker镜像的私有仓库(一般是公司内网的registry),我们这里假设私有仓库IP为10.27.168.88,则需要
ExecStart=/usr/bin/dockerd -H fd:// -s overlay2 --dns 10.xx.xxx.xx --dns 8.8.8.8 --insecure-registry 10.27.168.88:5000
不想用ip也可以域名,只要做好dns解析就好了
eg:ExecStart=/usr/bin/dockerd -H fd:// -s overlay2 --dns 10.xx.xxx.xx --dns 8.8.8.8 --insecure-registry my_registry:5000
其中--dns 10.xx.xxx.xx是公司内网的dns服务器 ,my_registry是私有仓库的域名,如果没有可以直接用私有仓库ip来替代,不想用ip的可以在/etc/hosts下添加一下
10.27.168.88 my_registry #假设私有仓库的ip是10.27.168.88的话。
更多推荐
所有评论(0)