意外的是,我的docker出了问题,无法启动。
docker ps
给出以下错误
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
而systemctl status docker.service
给出了以下输出:
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/docker.service.d
└─override.conf
Active: failed (Result: start-limit-hit) since Tue 2018-11-20 18:27:11 PST; 11s ago
Docs: https://docs.docker.com
Process: 16519 ExecStart=/usr/bin/dockerd --host=fd:// --add-runtime=nvidia=/usr/bin/nvidia-container-runtime (code=exited, status=1/FAILURE)
Main PID: 16519 (code=exited, status=1/FAILURE)
Nov 20 18:27:09 loccalhost systemd[1]: Failed to start Docker Application Container Engine.
Nov 20 18:27:09 loccalhost systemd[1]: docker.service: Unit entered failed state.
Nov 20 18:27:09 loccalhost systemd[1]: docker.service: Failed with result 'exit-code'.
Nov 20 18:27:11 loccalhost systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Nov 20 18:27:11 loccalhost systemd[1]: Stopped Docker Application Container Engine.
Nov 20 18:27:11 loccalhost systemd[1]: docker.service: Start request repeated too quickly.
Nov 20 18:27:11 loccalhost systemd[1]: Failed to start Docker Application Container Engine.
Nov 20 18:27:11 loccalhost systemd[1]: docker.service: Unit entered failed state.
Nov 20 18:27:11 loccalhost systemd[1]: docker.service: Failed with result 'start-limit-hit'.
发布于 2019-03-02 13:49:22
skyuua提到的同一线程中的more recent answer建议如下(它将-H fd://更改为-H unix://)
sudo systemctl编辑docker.service
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H unix:// -H tcp://127.0.0.1:2375
紧接着是
sudo systemctl守护进程-重新加载
sudo systemctl重启docker.service
在我的Ubuntu16.04和docker 18.0.3上,这重写了/etc/systemd/system/docker.service.d/override.conf文件,允许docker正确启动。
发布于 2019-03-15 08:07:13
我们运行sudo apt-get update,我们的docker版本也更新了,从18.09.1更改为18.09.3,docker变得混乱。经过网上挖掘,我找到了下面的解决方案,为我们解决了问题。
sudo systemctl edit docker.service
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd-ce -H unix://var/run/docker.sock -H tcp://0.0.0.0:2375
然后重启服务
sudo systemctl restart docker.service
https://stackoverflow.com/questions/53404557
复制