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博客

相关推荐
Sheffield2 天前
Docker的跨主机服务与其对应的优缺点
linux·网络协议·docker
Sheffield2 天前
Alpine是什么,为什么是Docker首选?
linux·docker·容器
马艳泽2 天前
win10下运行Start Broker and Proxy报错解决
docker
用户13573999256603 天前
Windows 从 0 搭建 WSL2 原生 AI 开发环境:Codex + Docker + VSCode
docker
vi_h3 天前
在 macOS 上通过 Docker 安装并运行 Ollama(详细可执行教程)
macos·docker·ollama
黑心老魔3 天前
通过 Docker 创建开发环境
docker·开发环境
冬奇Lab4 天前
一天一个开源项目(第41篇):Workout.cool - 现代化开源健身教练平台,训练计划与进度追踪
docker·开源·资讯
天朝八阿哥4 天前
使用Docker+vscode搭建离线的go开发调试环境
后端·docker·visual studio code
阿虎儿5 天前
Docker安装(非sudo用户可用)
docker
fetasty6 天前
rustfs加picgo图床搭建
docker