docker 如何配置国内镜像地址
docker 使用国内源下载可以加快某些image的下载速度
使用国内镜像
vi /etc/docker/daemon.json
# daemon.json
"registry-mirrors": ["地址"]
# 重启
systemctl daemon-reload
service docker restart
# 检查配置是否生效
docker info
国内加速地址
1.网易
http://hub-mirror.c.163.com
2.Docker中国区官方镜像
https://registry.docker-cn.com
3.中国科技大学
https://docker.mirrors.ustc.edu.cn
4.阿里云容器 服务
https://cr.console.aliyun.com/
5.七牛云加速器
https://reg-mirror.qiniu.com
6.腾讯云容器服务
https://mirror.ccs.tencentyun.com
/etc/docker/daemon.json 配置例子
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"default-ulimits": {
"nofile": {
"Hard": 64000,
"Name": "nofile",
"Soft": 64000
}
},
"dns": [
"127.0.0.1",
"119.29.29.29",
"8.8.8.8"
],
"experimental": false,
"features": {
"buildkit": true
},
"live-restore": true,
"log-driver": "json-file",
"log-opts": {
"max-file": "3",
"max-size": "512m"
},
"registry-mirrors": [
"http://hub-mirror.c.163.com",
"https://registry.docker-cn.com",
"https://mirror.baidubce.com",
"https://mirror.ccs.tencentyun.com",
"https://hub-mirror.c.163.com",
"https://ustc-edu-cn.mirror.aliyuncs.com",
"https://ghcr.io"
]
}
文章评论