当前位置: 代码网 > it编程>编程语言>Javascript > docker设置国内镜像源

docker设置国内镜像源

2024年08月01日 Javascript 我要评论
创建或修改 /etc/docker/daemon.json 文件,修改为如下形式。登录:cr.console.aliyun.com。2、中国科技大学 USTC:(仅供内部访问)点击“创建我的容器镜像”,得到专属加速地址。1、Docker 中国官方镜像:(已关闭)1、阿里云镜像站:(需登录,免费)阿里云容器 生成自己的加速地址。Docker Hub 镜像测速。加载重启docker。

一、国内加速地址

1、阿里云镜像站:(需登录,免费)

https://<your_code>.mirror.aliyuncs.com

2、网易云镜像站:

http://hub-mirror.c.163.com

3、百度云镜像站:

https://mirror.baidubce.com

4、上海交大镜像站:

https://docker.mirrors.sjtug.sjtu.edu.cn

5、南京大学镜像站:

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:latest

pulling repository nginx
[...]

real   1m14.078s
user   0m0.176s
sys    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

-ref
docker 设置国内镜像源_docker国内镜像源-csdn博客

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com