当前位置:首页 » 《关注互联网》 » 正文

docker使用报错记录

6 人参与  2024年04月01日 08:25  分类 : 《关注互联网》  评论

点击全文阅读


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/

然后应该不会报错了

从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


点击全文阅读


本文链接:http://zhangshiyu.com/post/88749.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1