-2

运行任何 docker 命令时出现上述错误。当我运行以下命令时


$ sudo docker info
输出

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?



所有 docker 命令都不起作用。他们都抛出相同的错误。


$ sudo systemctl status docker
输出。

● 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
           └─docker-override.conf
   Active: inactive (dead) (Result: exit-code) since Mon 2018-07-02 09:27:04 EDT; 1min 2s ago
     Docs: https://docs.docker.com
  Process: 23866 ExecStart=/usr/bin/dockerd -H fd:// -s overlay2 --disable-legacy-registry=false <br>(code=exited, status=1/FAILURE)
 Main PID: 23866 (code=exited, status=1/FAILURE)

Jul 02 09:27:04 cse-bennettuniv systemd[1]: Failed to start Docker Application Container Engine.
Jul 02 09:27:04 cse-bennettuniv systemd[1]: docker.service: Unit entered failed state.
Jul 02 09:27:04 cse-bennettuniv systemd[1]: docker.service: Failed with result 'exit-code'.
Jul 02 09:27:04 cse-bennettuniv systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jul 02 09:27:04 cse-bennettuniv systemd[1]: Stopped Docker Application Container Engine.
Jul 02 09:27:04 cse-bennettuniv systemd[1]: docker.service: Start request repeated too quickly.
Jul 02 09:27:04 cse-bennettuniv systemd[1]: Failed to start Docker Application Container Engine.


$ sudo systemctl status nvidia-docker
输出

● nvidia-docker.service - NVIDIA Docker plugin
   Loaded: loaded (/lib/systemd/system/nvidia-docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2018-07-02 08:54:55 EDT; 37min ago
     Docs: https://github.com/NVIDIA/nvidia-docker/wiki
 Main PID: 3173 (nvidia-docker-p)
    Tasks: 10
   Memory: 61.8M
      CPU: 3.739s
   CGroup: /system.slice/nvidia-docker.service
           └─3173 /usr/bin/nvidia-docker-plugin -s /var/lib/nvidia-docker

Jul 02 08:54:55 cse-bennettuniv systemd[1]: Starting NVIDIA Docker plugin...
Jul 02 08:54:55 cse-bennettuniv systemd[1]: Started NVIDIA Docker plugin.
Jul 02 08:54:55 cse-bennettuniv nvidia-docker-plugin[3173]: /usr/bin/nvidia-docker-plugin | 2018/07/02 08:54:55 Loading NVIDIA unified memory
Jul 02 08:54:55 cse-bennettuniv nvidia-docker-plugin[3173]: /usr/bin/nvidia-docker-plugin | 2018/07/02 08:54:55 Loading NVIDIA management library
Jul 02 08:54:55 cse-bennettuniv nvidia-docker-plugin[3173]: /usr/bin/nvidia-docker-plugin | 2018/07/02 08:54:55 Discovering GPU devices
Jul 02 08:54:59 cse-bennettuniv nvidia-docker-plugin[3173]: /usr/bin/nvidia-docker-plugin | 2018/07/02 08:54:59 Provisioning volumes at /var/lib/nvidia-docker/volumes
Jul 02 08:54:59 cse-bennettuniv nvidia-docker-plugin[3173]: /usr/bin/nvidia-docker-plugin | 2018/07/02 08:54:59 Serving plugin API at /var/lib/nvidia-docker
Jul 02 08:54:59 cse-bennettuniv nvidia-docker-plugin[3173]: /usr/bin/nvidia-docker-plugin | 2018/07/02 08:54:59 Serving remote API at localhost:3476


当我运行以下命令时...
$ sudo service docker restart
输出
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”,还运行了“journalctl -xe”命令来了解问题所在。journalctl 输出包含

Jul 03 13:23:06 cse-bennettuniv systemd[1]: Starting Docker Application Container Engine...
Jul 03 13:23:06 cse-bennettuniv dockerd[9390]: ERROR: The '--disable-legacy-registry' flag has been removed. Interacting with legacy (v1) registries is no longer supported
Jul 03 13:23:06 cse-bennettuniv systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Jul 03 13:23:06 cse-bennettuniv systemd[1]: Failed to start Docker Application Container Engine.
Jul 03 13:23:06 cse-bennettuniv systemd[1]: docker.service: Unit entered failed state.
Jul 03 13:23:06 cse-bennettuniv systemd[1]: docker.service: Failed with result 'exit-code'.
Jul 03 13:23:06 cse-bennettuniv systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jul 03 13:23:06 cse-bennettuniv systemd[1]: Stopped Docker Application Container Engine.

“journalctl -xe”命令抛出的outpot的更完整的txt文件


4

1 回答 1

1

感谢@DavidMaze 和@Exa 完善了这个问题。
我用谷歌搜索了这个特定的错误ERROR: The '--disable-legacy-registry' flag has been removed. Interacting with legacy (v1) registries is no longer supported。然后我将它从文件中删除并保存。之后,它工作正常,但在 nvidia-docker 中出现了一个新错误。所以我的上级建议我重新安装 docker 和 nvidia-docker。
我按照这个链接重新安装东西。一切都安装好了,没有任何错误。但是当我尝试启动 nvidia-docker 时,它盯着抛出了这个特定的错误:Failed to start nvidia-docker.service: Unit nvidia-docker.service not found.

以下是详细信息。


sudo systemctl status docker

● 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
           └─docker-override.conf
   Active: active (running) since Thu 2018-07-05 14:49:50 EDT; 23s ago
     Docs: https://docs.docker.com
 Main PID: 60189 (dockerd)
    Tasks: 51
   Memory: 239.4M
      CPU: 723ms
   CGroup: /system.slice/docker.service
           ├─60189 /usr/bin/dockerd -H fd:// -s overlay2
           └─60200 docker-containerd --config /var/run/docker/containerd/containerd.toml

Jul 05 14:49:50 cse-bennettuniv dockerd[60189]: time="2018-07-05T14:49:50.795448032-04:00" level=warning msg="Your kernel does not support swap memory limit"
Jul 05 14:49:50 cse-bennettuniv dockerd[60189]: time="2018-07-05T14:49:50.795489588-04:00" level=warning msg="Your kernel does not support cgroup rt period"
Jul 05 14:49:50 cse-bennettuniv dockerd[60189]: time="2018-07-05T14:49:50.795499101-04:00" level=warning msg="Your kernel does not support cgroup rt runtime"
Jul 05 14:49:50 cse-bennettuniv dockerd[60189]: time="2018-07-05T14:49:50.796089811-04:00" level=info msg="Loading containers: start."
Jul 05 14:49:50 cse-bennettuniv dockerd[60189]: time="2018-07-05T14:49:50.886351523-04:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon opti
Jul 05 14:49:50 cse-bennettuniv dockerd[60189]: time="2018-07-05T14:49:50.913124323-04:00" level=info msg="Loading containers: done."
Jul 05 14:49:50 cse-bennettuniv dockerd[60189]: time="2018-07-05T14:49:50.932021936-04:00" level=info msg="Docker daemon" commit=9ee9f40 graphdriver(s)=overlay2 version=18.03.1-ce
Jul 05 14:49:50 cse-bennettuniv dockerd[60189]: time="2018-07-05T14:49:50.932079832-04:00" level=info msg="Daemon has completed initialization"
Jul 05 14:49:50 cse-bennettuniv dockerd[60189]: time="2018-07-05T14:49:50.938512369-04:00" level=info msg="API listen on /var/run/docker.sock"
Jul 05 14:49:50 cse-bennettuniv systemd[1]: Started Docker Application Container Engine.

sudo systemctl status nvidia-docker

● nvidia-docker.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

Jul 05 14:40:51 cse-bennettuniv systemd[1]: Stopped NVIDIA Docker plugin.
Jul 05 14:40:51 cse-bennettuniv systemd[1]: Stopped NVIDIA Docker plugin.
Jul 05 14:44:07 cse-bennettuniv systemd[1]: Stopped NVIDIA Docker plugin.
Jul 05 14:44:07 cse-bennettuniv systemd[1]: Stopped NVIDIA Docker plugin.

这里给出了没有这样的文件或目录的原因。


sudo service nvidia-docker start
Failed to start nvidia-docker.service: Unit nvidia-docker.service not found.
我这样做是为了解决这个问题。但是当我运行以下代码时,它得到了证实/lib/systemd/system


dgxuser@cse-bennettuniv:/lib/systemd/system$ ls | grep nvidia
nvidia-persistenced.service
这意味着没有名为nvidia-docker.service 的文件。现在即使正确安装后我也不明白,为什么我无法启动nvidia-docker?

于 2018-07-05T19:39:19.437 回答