福州大学城论坛

 找回密码
 立即注册
开启左侧

docker设置国内镜像源

[复制链接]
发表于 2025-1-12 21:37:43 | 显示全部楼层 |阅读模式 来自 LAN
一、国内加速地址

1、阿里云镜像站:(需登录,免费)
https://<your_code>.mirror.aliyuncs.com2、网易云镜像站:
http://hub-mirror.c.163.com3、百度云镜像站:
https://mirror.baidubce.com4、上海交大镜像站:
https://docker.mirrors.sjtug.sjtu.edu.cn5、南京大学镜像站:
https://docker.nju.edu.cn               

以下连接不公开或已失效:
1、Docker 中国官方镜像:(已关闭)
https://registry.docker-cn.com
2、中国科技大学 USTC:(仅供内部访问)
https://docker.mirrors.ustc.edu.cn




阿里云容器 生成自己的加速地址
登录:cr.console.aliyun.com
点击“创建我的容器镜像”,得到专属加速地址。
3a11a7922ce0a0f8fe46743f8bdebf5d.png

二、修改方法

创建或修改 /etc/docker/daemon.json 文件,修改为如下形式
{    "registry-mirrors": [        "https://registry.hub.docker.com",        "http://hub-mirror.c.163.com",        "https://mirror.baidubce.com",        "https://docker.mirrors.sjtug.sjtu.edu.cn",        "https://docker.nju.edu.cn"    ]}加载重启docker
systemctl restart docker查看是否成功
docker info
3b2b43d8c82b1b329e1d3e65f80d0e9f.png

Docker Hub 镜像测速
# 测速前先移除本地的镜像!$ docker rmi nginx:latest# 使用 time 统计所花费的总时间。$ time docker pull nginx:latestPulling repository nginx[...]real   1m14.078suser   0m0.176ssys    0m0.120s三、从指定repo拉取镜像

命令格式: library/<image:version>
$ docker pull busybox # 指定Repo拉取镜像,等价于:$ docker pull hub-mirror.c.163.com/library/busybox:latest$ docker pull docker.io/library/busybox:latest$ docker pull registry.hub.docker.com/library/busybox:latest
    本文来自博客园,作者:木子欢儿,转载请注明原文链接:https://www.cnblogs.com/HGNET/p/18008789
福州大学城论坛 - 声明 1、在发表言论时,请遵守当地法律法规。主题所有言论纯属个人意见,与本站立场无关。
2、本站所有主题由作者发表,作者享有帖子相关版权,其他单位或个人使用、转载或引用本文时必须征得作者同意并注明来源于福州大学城论坛
3、如本帖侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意。
4、帖子不遵守当地法律法规、广告、人身攻击等情况时,福州大学城论坛管理人员有权不事先通知发贴者而删除本文。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|福州大学城论坛 ( 闽ICP备2022007610号-2 )|站点地图

GMT+8, 2025-2-5 20:53 , Processed in 0.080522 second(s), 7 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表