admin 发表于 2025-1-12 21:37:43

docker设置国内镜像源

一、国内加速地址

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
点击“创建我的容器镜像”,得到专属加速地址。

二、修改方法

创建或修改 /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
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]
查看完整版本: docker设置国内镜像源