码迷,mamicode.com
首页 > 其他好文 > 详细

docker出现如下错误:Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

时间:2019-01-09 11:11:52      阅读:2309      评论:0      收藏:0      [点我收藏+]

标签:gis   eof   new   除了   run   nvidia   color   art   https   

在docker中配置deepo时出现了错误:

技术分享图片

在出现这个错误之前,我是先用如下命令查看NVIDIA-docker是否安装成功。

 docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi

出现如下显示:

技术分享图片

在网上查看原因,显示是nvidia-docker 没有注册,具体查看https://blog.csdn.net/weixin_32820767/article/details/80538510

然后按照博客提示进行注册,通过下面的步骤:

#To register the nvidia runtime, use the method below that is best suited to your environment.
#You might need to merge the new argument with your existing configuration.

#Systemd drop-in file
sudo mkdir
-p /etc/systemd/system/docker.service.d sudo tee /etc/systemd/system/docker.service.d/override.conf <<EOF [Service] ExecStart= ExecStart=/usr/bin/dockerd --host=fd:// --add-runtime=nvidia=/usr/bin/nvidia-container-runtime EOF sudo systemctl daemon-reload sudo systemctl restart docker
#Daemon configuration file
sudo tee
/etc/docker/daemon.json <<EOF { "runtimes": { "nvidia": { "path": "/usr/bin/nvidia-container-runtime", "runtimeArgs": [] } } } EOF sudo pkill -SIGHUP dockerd

这里主要是在/etc/systemd/system/docker.service.d目录下新建文件override.conf,并写入ExecStart启动的路径。

完成后就出现了如上错误,docker无法启动了。

于是我又删除了override.conf文件后又可以启动了,但是NVIDIA-DOCKER还是无法启动。

 

docker出现如下错误:Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

标签:gis   eof   new   除了   run   nvidia   color   art   https   

原文地址:https://www.cnblogs.com/fuhang/p/10242379.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!