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

相关推荐
漫无目的行走的月亮2 小时前
在Docker中运行微服务注册中心Eureka
docker
大道归简5 小时前
Docker 命令从入门到入门:从 Windows 到容器的完美类比
windows·docker·容器
zeruns8026 小时前
如何搭建自己的域名邮箱服务器?Poste.io邮箱服务器搭建教程,Linux+Docker搭建邮件服务器的教程
linux·运维·服务器·docker·网站
爱跑步的程序员~6 小时前
Docker
docker·容器
疯狂的大狗6 小时前
docker进入正在运行的容器,exit后的比较
运维·docker·容器
长天一色6 小时前
【Docker从入门到进阶】01.介绍 & 02.基础使用
运维·docker·容器
伊玛目的门徒6 小时前
docker 搭建minimalist-web-notepad
运维·docker·notepad
theo.wu9 小时前
使用Buildpacks构建Docker镜像
运维·docker·容器
wusam18 小时前
螺蛳壳里做道场:老破机搭建的私人数据中心---Centos下Docker学习04(环境准备)
学习·docker·centos
wusam21 小时前
螺蛳壳里做道场:老破机搭建的私人数据中心---Centos下Docker学习03(网络及IP规划)
运维·服务器·网络·docker·容器