更换docke镜像源
创建或修改 /etc/docker/daemon.json 文件
安装docker后一般只有 /etc/docker 这个目录 下面并没有 daemon.json 文件
我们直接创建 : vim /etc/docker/daemon.json
{
"registry-mirrors" : [
"https://dk3fghkb.mirror.aliyuncs.com",
"https://docker.m.daocloud.io",
"https://docker.jianmuhub.com",
"https://huecker.io",
"https://dockerhub.timeweb.cloud",
"https://dockerhub1.beget.com",
"https://noohub.ru",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn",
"https://cr.console.aliyun.com",
"https://mirror.ccs.tencentyun.com"
]
}
# 或者直接这样写入镜像配置 sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors" : [ "https://dk3fghkb.mirror.aliyuncs.com", "https://docker.m.daocloud.io", "https://docker.jianmuhub.com", "https://huecker.io", "https://dockerhub.timeweb.cloud", "https://dockerhub1.beget.com", "https://noohub.ru", "https://registry.docker-cn.com", "http://hub-mirror.c.163.com", "https://docker.mirrors.ustc.edu.cn", "https://cr.console.aliyun.com", "https://mirror.ccs.tencentyun.com" ] } EOF
Docker国内镜像:
https://registry.docker-cn.com网易:
http://hub-mirror.c.163.comustc:
https://docker.mirrors.ustc.edu.cn中国科技大学:
https://docker.mirrors.ustc.edu.cn阿里云:
https://cr.console.aliyun.com/腾讯云:
https://mirror.ccs.tencentyun.com
重启docker服务使配置生效:
systemctl daemon-reload
systemctl restart docker.service
查看docker配置:
docker info