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

相关推荐
xuhe217 分钟前
🛠️ 深度解析我的 Overleaf 私有化部署:一份稳定、高兼容性的 `docker-compose.yaml`
linux·docker·科研·overleaf
白小云<1 小时前
docker镜像
docker·容器·eureka
何故染尘優1 小时前
docker学习笔记,从入门开始!
笔记·学习·docker
不爱笑的良田2 小时前
从零开始的云原生之旅(一):把 Go 应用塞进 Docker
docker·云原生·golang
java_logo4 小时前
Docker 部署 Rocky Linux 全流程教程
linux·运维·服务器·docker·容器·1024程序员节
2501_938791834 小时前
服务器镜像安全:Docker 镜像漏洞扫描(Trivy)与基础镜像优化
服务器·安全·docker
老司机张师傅5 小时前
【微服务实战之Docker容器】第十章-compose容器编排
docker·微服务·架构
ghie90905 小时前
利用 Docker 和 Kubernetes 实现微服务部署
docker·微服务·kubernetes
奔跑吧 android6 小时前
【Docker】【03.使用docker搭建ubuntu20.04 Qt5.12 开发环境】
qt·docker·ubuntu20.04·qt5.12
scriptsboy9 小时前
可用 Docker (DockerHub) 国内镜像源加速列表 - 长期维护(截至 2025 年 06 月 15 日)
运维·docker·容器