目 录CONTENT

文章目录

【GitHub资源转载】Docker Hub 镜像加速器

邱少羽梦
2023-06-14 / 0 评论 / 0 点赞 / 551 阅读 / 9682 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2024-10-31,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

1️⃣ Docker daemon 配置代理(推荐)

参考 Docker daemon 配置代理

2️⃣ 自建镜像加速服务

3️⃣ 国内三方加速镜像

⚠️⚠️⚠️ 自 2024-06-06 开始,国内的 Docker Hub 镜像加速器相继停止服务,可选择为 Docker daemon 配置代理或自建镜像加速服务。


Ubuntu 16.04+、Debian 8+、CentOS 7+

创建或修改 /etc/docker/daemon.json

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
    "registry-mirrors": [
        "https://docker.m.daocloud.io",
        "https://dockerproxy.com",
        "https://docker.mirrors.ustc.edu.cn",
        "https://docker.nju.edu.cn",
        "https://dockerhub.icu",
        "https://docker.chenby.cn",
        "https://docker.1panel.live",
        "https://docker.awsl9527.cn",
        "https://docker.anyhub.us.kg",
        "https://dhub.kubesre.xyz"
    ]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

Docker Hub 镜像加速器列表

Docker 官方和国内很多云服务商都提供了国内加速器服务。以下镜像站来源于互联网(感谢热心网友),可能出现宕机、转内网、关停等情况,建议同时配置多个镜像源。

镜像加速器镜像加速器地址专属加速器其它加速
Docker 中国官方镜像https://registry.docker-cn.com Docker Hub已关闭
DaoCloud 镜像站https://docker.m.daocloud.io白名单模式Docker Hub、GCR、K8S、GHCR、Quay、NVCR 等
Azure 中国镜像https://dockerhub.azk8s.cn仅供内部访问Docker Hub、GCR、Quay
科大镜像站https://docker.mirrors.ustc.edu.cn仅供内部访问Docker HubGCRQuay
阿里云https://<your_code>.mirror.aliyuncs.com需登录,系统分配Docker Hub
七牛云https://reg-mirror.qiniu.com Docker Hub、GCR、Quay
网易云https://hub-mirror.c.163.com Docker Hub
腾讯云https://mirror.ccs.tencentyun.com仅供内部访问Docker Hub
Docker 镜像代理https://dockerproxy.com Docker Hub、GCR、K8S、GHCR
百度云https://mirror.baidubce.com Docker Hub
南京大学镜像站https://docker.nju.edu.cn Docker Hub、GCR、GHCR、Quay、NVCR 等
上海交大镜像站https://docker.mirrors.sjtug.sjtu.edu.cn Docker Hub、GCR 等已关闭
中科院软件所镜像站https://mirror.iscas.ac.cn Docker Hub

⚠️ 部分网友反馈以下镜像站存在未同步最新源镜像问题,请按需选用(评论区可考古)

  • 阿里云

检查加速器是否生效

命令行执行 docker info,如果从结果中看到了如下内容,说明配置成功。

Registry Mirrors:
 [...]
 https://docker.m.daocloud.io

Docker Hub 镜像测速

使用镜像前后,可使用 time 统计所花费的总时间。测速前先移除本地的镜像!

$ docker rmi node:latest
$ time docker pull node:latest
Pulling repository node
[...]

real   1m14.078s
user   0m0.176s
sys    0m0.120s

更新日志

2024.06.11
2024.06.06
  • 🚫 失效加速器
    • 上海交大镜像站
      • https://sjtug.org/post/mirror-news/2024-06-06-takedown-dockerhub/

感谢 @hangone 提供反馈

2024.01.10
  • 🚫 失效加速器
    • 网易云镜像

感谢网友 @joelhy @MalikWilliams1greher 的反馈

2023.12.21
  • 🆕 新增加速器
    • 中科院软件所镜像站
      • https://mirror.iscas.ac.cn/
      • https://mirror.iscas.ac.cn/mirror/docker.html

感谢网友 @ApsarasX @snowdream 提供反馈

2023.06.19
  • 🆕 新增加速器
    • 上海交大镜像站
      • https://mirrors.sjtug.sjtu.edu.cn/
      • https://mirrors.sjtug.sjtu.edu.cn/docs/docker-registry

感谢网友 @shadowofmoo 的反馈

2023.03.14
  • 🆕 新增加速器
    • 南京大学镜像站
      • https://doc.nju.edu.cn/books/35f4a
      • https://sci.nju.edu.cn/9e/05/c30384a564741/page.htm

感谢网友 @msojocs 的反馈

2023.03.04
  • 🔒 已转为私有
    • 科大镜像站

感谢网友 @ionlz 的反馈

2023.02.22
  • 🆕 新增加速器
    • 百度云镜像
  • 🔒 已转为私有
    • Azure 中国镜像
    • 腾讯云镜像
  • 🚫 失效加速器
    • 七牛云镜像

感谢网友 @YiuTerran 的反馈


参考链接

  • https://docs.docker.com/registry/recipes/mirror/
  • https://github.com/yeasy/docker_practice/blob/master/install/mirror.md
  • https://github.com/moby/moby/blob/d409b05970e686993e343d226fae5b463d872082/docs/articles/registry_mirror.md
  • https://www.fengbohello.top/archives/docker-registry-mirror
  • https://www.ilanni.com/?p=14534
  • https://github.com/Azure/container-service-for-azure-china/blob/master/aks/README.md#22-container-registry-proxy
  • https://moelove.info/2020/09/20/突破-DockerHub-限制全镜像加速服务/

博主转载声明

博主转载对自己有用的文章,以便不时之需,不进行商业用途,希望博主的转载也能帮助到您,如果对您有帮助,也请您支持下原作者哦。
文章内容全部转载,原文地址:
https://gist.github.com/y0ngb1n/7e8f16af3242c7815e7ca2f0833d3ea6
0
  1. 支付宝打赏

    qrcode alipay
  2. 微信打赏

    qrcode weixin
  3. QQ打赏

    qrcode qq

评论区