使用国内镜像源进行 Docker 配置
最编程
2023-12-30 21:53:55
...
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
以下连接不公开或已失效:
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
https://blog.****.net/whatday/article/details/86770609
上一篇: 5566:更多意义超越数字的来源。
推荐阅读
-
使用docker-compose进行redis服务的配置和部署
-
国内使用 Docker 从 GitLab 拉取镜像速度慢的问题与 GitLab Docker CI 的解决方案
-
Docker 配置国内镜像源加速
-
如何在Python中设置pip使用国内镜像源
-
如何在Docker Desktop上设置国内的镜像源
-
如何设置pip的镜像源:切换到国内镜像、禁用海外源及详细配置步骤
-
使用国内镜像源来加速python pypi包的安装
-
如何在国内使用Pip安装镜像源的步骤指南
-
如何快速设置 Docker 在国内的加速镜像源 (2021年1月15日更新)
-
快速掌握 Docker(第二步):配置国内镜像源与常用操作指令