docker_镜像下载加速

国内下载docker镜像速度会比较慢

查看现状

1
sudo docker info

有如下信息

1
2
Registry Mirrors:
https://xxxx.com/

修改

创建或修改 /etc/docker/daemon.json 文件,并写入以下内容:

1
2
3
4
5
6
7
8
9
10
{
"registry-mirrors": [
"https://mirror.ccs.tencentyun.com"
]
}

我的为例
{ "insecure-registries":["192.168.0.40:5000"],
"registry-mirrors": ["https://hub-mirror.c.163.com/"]
}

依次执行以下命令,重新启动 Docker 服务。

1
2
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker

验证修改(同查看现状)

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×