Augety

  • 首页
  • GPT
  • 我们的故事
  • 隐私政策
个人博客
  1. 首页
  2. 开发经验
  3. 正文

开发经验-Docker无法拉取镜像

2025年 6月 19日 45点热度 0人点赞 0条评论

如果在拉取 Docker 镜像时遇到问题

例如:

Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

由于国内网络限制,需编辑 /etc/docker/daemon.json 文件并添加以下内容(如果不存在就创建):

编辑

sudo vi /etc/docker/daemon.json 

添加如下JSON配置(如果原本有其他配置,追加json字段registry-mirrors即可)

{
  "registry-mirrors": [
    "https://docker.m.daocloud.io",
    "https://noohub.ru",
    "https://huecker.io",
    "https://dockerhub.timeweb.cloud",
    "https://docker.rainbond.cc",
    "https://dockerhub.icu",
    "https://docker.chenby.cn",
    "https://docker.1panel.live",
    "https://docker.awsl9527.cn",
    "https://docker.anyhub.us.kg",
    "https://dhub.kubesre.xyz",
    "https://docker.1ms.run",
    "https://docker.xuanyuan.me"
  ]
}

完成编辑后,重新加载 daemon.json 文件并重启 Docker:

sudo systemctl daemon-reload
sudo systemctl restart docker
本作品采用 知识共享署名-非商业性使用 4.0 国际许可协议 进行许可
标签: Docker
最后更新:2025年 6月 19日

Augety

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

归档

  • 2025 年 6 月
  • 2024 年 8 月

分类

  • 国产化
  • 开发经验

COPYRIGHT © 2024 lcj. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

闽ICP备2024060504号

闽公网安备35021202000672号