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

相关推荐
shandianchengzi3 小时前
【记录】Tailscale|部署 Tailscale 到 linux 主机或 Docker 上
linux·运维·docker·tailscale
肉肉心很软5 小时前
使用onlyoffice实现文件预览编辑 + Docker一键部署流程
运维·docker·容器
-大头.5 小时前
Docker实战:构建高性能MySQL主从复制集群(读写分离)
mysql·docker·容器
LuiChun5 小时前
Docker Compose 容器服务查询与文件查看操作指南(Windows Docker Desktop 版)【一】
linux·运维·windows·docker·容器
goodlook01236 小时前
安装最新版本docker-26.1.4
运维·docker·容器
❀͜͡傀儡师6 小时前
docker安装部署PostgreSQL带有pgvector扩展向量数据(高维数组)
docker·postgresql·容器·pgvector
IT_Octopus7 小时前
Docker 镜像打的包有1.3个G 多阶段构建缩小镜像体积(不算成功)
运维·docker·容器
陈陈CHENCHEN8 小时前
【Kubernetes】镜像拉取密钥 - Docker Registry
docker·kubernetes
Bits to Atoms8 小时前
宇树机器人二次开发环境配置 -- docker创建
运维·docker·容器
码农小卡拉11 小时前
Docker Compose部署EMQX集群详细教程(Ubuntu环境优化版)
mqtt·ubuntu·docker·容器·emqx