问题描述
使用docker下载镜像时,报错 error pulling image configuration: download failed after attempts=6: dial tcp 202.160.129.37:443: connect: connection refused
解决思路
一、检查网络是否正常
ping www.baidu.com # 正常
二、检查防火墙是否关闭
# 关闭firewalld
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
# 关闭iptables
yum install iptables-services
systemctl status iptables.service
systemctl stop iptables.service
systemctl disable iptables.service
cd /etc/sysconfig
mv /etc/sysconfig/iptables /etc/sysconfig/iptables.bak
mv /etc/sysconfig/iptables-config /etc/sysconfig/iptables-config.bak
touch /etc/sysconfig/iptables
touch /etc/sysconfig/iptables-config
#或者将iptables中的策略清空
iptables -F
iptables-save
三、增加镜像加速代理
vim /etc/docker/daemon.json
{
"registry-mirrors": [
"https://xxxx.mirror.aliyuncs.com",
"https://docker.m.daocloud.io",
"https://dockerproxy.com",
"https://docker.mirrors.ustc.edu.cn",
"https://docker.nju.edu.cn",
"https://dockerhub.icu",
"https://docker.chenby.cn",
"https://docker.1panel.live",
"https://docker.awsl9527.cn",
"https://docker.anyhub.us.kg",
"https://dhub.kubesre.xyz"
]
}
systemctl daemon-reload
systemctl restart docker
其中阿里云镜像加速需到自己的阿里云控制台获得。产品与服务-容器-容器镜像服务-镜像工具-镜像加速器
使用 docker info 命令检查镜像加速是否已配置