解决docker pull超时失败

问题描述

使用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 命令检查镜像加速是否已配置

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值