docker镜像源配置及pull
20 May 2023
Docker镜像源配置及pull问题解决
修改镜像地址 在/etc/docker/目录下新建daemon.json文件,如果有就修改,添加如下内容:
{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/","https://hub-mirror.c.163.com","https://registry.docker-cn.com"]
}
修改resolv.ocnf 在 /etc/resolv.conf 添加 nameserver 解析地址:
nameserver 8.8.4.4
nameserver 8.8.8.8
重启 docker服务 常用命令
# 启动:
systemctl start docker
# 守护进程重启:
systemctl daemon-reload
# 重启docker服务:
systemctl restart docker / service docker restart
# 关闭:
docker service docker stop / docker systemctl stop docker
参考: How to change the default docker registry from docker.io to my private registry?
