0


docker使用报错记录

1. Error response from daemon: Mounts denied:

Error response from daemon: Mounts denied:
The path /media is not shared from the host and is not known to Docker.
You can configure shared paths from Docker -> Preferences… -> Resources -> File Sharing.
See https://docs.docker.com/ for more info.

解决方法:
在 Docker -> Preferences… -> Resources -> File Sharing.中添加相应路径,根据报错中给出路径:

/media

,点击+,将

/media

路径添加进去并点击

Apply&Restart

在这里插入图片描述

2. Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed:

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as ‘legacy’
nvidia-container-cli: initialization error: load library failed: libnvidia-ml.so.1: cannot open shared object file: no such file or directory: unknown

3. Cannot connect to the Docker daemon at unix:///home/purples/.docker/desktop/docker.sock. Is the docker daemon running?

Cannot connect to the Docker daemon at unix:///home/purples/.docker/desktop/docker.sock. Is the docker daemon running?

解决方法:
一般重启docker即可:

systemctl restart docker

若还有问题,可能是因为下载了docker desktop,在个人目录留下了文件夹.docker,因此执行docker命令的时候默认去这里链接了。
则:

cd ~
rm-rf .docker/

然后应该不会报错了

  1. 从Docker上pull镜像时报错:

Get https://registry-1.docker.io/v2/: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

这是因为网络问题导致的报错,
解决方法:换源
修改

/etc/docker/daemon.json

文件,该文件用于配置项目参数,默认不存在,需自己创建:

vi /etc/docker/daemon.json

导入镜像仓库:
Docker 官方中国区:https://registry.docker-cn.com
网易:http://hub-mirror.c.163.com
中国科技大学:https://docker.mirrors.ustc.edu.cn
阿里云:https://pee6w651.mirror.aliyuncs.com
选择一个镜像即可:

{"registry-mirrors":["https://pee6w651.mirror.aliyuncs.com"]}

添加后保存并关闭。

参考:
【1】Cannot connect to the Docker daemon at unix:///home/user/.docker/desktop/docker.sock
【2】解决Docker在pull的时候报错Get https://registry-1.docker.io/v2/: net/http: request canceled (Client.Timeout e


本文转载自: https://blog.csdn.net/weixin_46336532/article/details/135058355
版权归原作者 purples. 所有, 如有侵权,请联系我们删除。

“docker使用报错记录”的评论:

还没有评论