gpt4 book ai didi

docker - 在Ubuntu 16.04上无法通过unix:///var/run/docker.sock连接到Docker守护程序

转载 作者:行者123 更新时间:2023-12-02 19:29:06 24 4
gpt4 key购买 nike

偶然,我的 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'.

最佳答案

skyuua提到的同一线程中的more recent answer建议以下内容(它将-H fd://更改为-H unix://)

sudo systemctl edit docker.service

[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H unix:// -H tcp://127.0.0.1:2375
其次是

sudo systemctl daemon-reload

sudo systemctl restart docker.service


在具有docker 18.0.3的Ubuntu 16.04上,这会重写文件/etc/systemd/system/docker.service.d/override.conf,该文件允许docker正确启动。

关于docker - 在Ubuntu 16.04上无法通过unix:///var/run/docker.sock连接到Docker守护程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53404557/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com