Docker pull镜像一直在Waiting无法下载,根本解决方法

1、现象描述:

docker pull 拉去镜像一直在等待,无法下载,最后失败如下:

bash 复制代码
[root@localhost docker]# docker pull zookeeper
Using default tag: latest
latest: Pulling from library/zookeeper
2ec76a50fe7c: Retrying in 1 second
fab7f202453a: Retrying in 1 second
ee59ca42def8: Retrying in 1 second
2ce2282f972f: Waiting
d2a9e456ba82: Waiting
b59edc04016d: Waiting
1e52b217ebb4: Waiting
7a5027dbe828: Waiting
4f4fb700ef54: Waiting
8e018b2f6fcb: Waiting
error pulling image configuration: download failed after attempts=6: dial tcp 199.59.148.246:443: connect: connection refused

2、现象分析:

经排查分析:

  • 原因1:服务器DNS无法解析
  • 原因2:docker 源有问题

3、解决方法:

3.1、配置并更新DNS

以CentOS7为例,直接操作哦:

bash 复制代码
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DNS1=223.5.5.5
DNS2=223.6.6.6



vi /etc/resolv.conf
nameserver 223.5.5.5
nameserver 223.6.6.6
nameserver 8.8.8.8



systemctl restart network


###测试一下 是否联通
ping  223.5.5.5

3.2、更新docker源,换成国内源

bash 复制代码
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://mirror.ccs.tencentyun.com/"]
}
EOF



sudo systemctl daemon-reload
sudo systemctl restart docker

3.3、同步时间

bash 复制代码
####需安装ntp, 自行搜

ntpdate ntp1.aliyun.com

4、结果如下,6得很:

bash 复制代码
[root@localhost docker]# docker pull zookeeper
Using default tag: latest
latest: Pulling from library/zookeeper
a2abf6c4d29d: Pull complete
2bbde5250315: Pull complete
202a34e7968e: Pull complete
4e4231e30efc: Pull complete
707593b95343: Pull complete
b070e6dedb4b: Pull complete
46e5380f3905: Pull complete
8b7e330117e6: Pull complete
Digest: sha256:2c8c5c2db6db22184e197afde13e33dad849af90004c330f20b17282bcd5afd7
Status: Downloaded newer image for zookeeper:latest
docker.io/library/zookeeper:latest
相关推荐
A-刘晨阳7 小时前
Kubernetes 查询证书有效期及续签证书(适用于二进制部署)
云原生·容器·kubernetes·证书·cfssl
`Levie14 小时前
Docker-安装部署、容器管理(一)
docker·容器·eureka
Diligently_19 小时前
第 08 篇|单机部署:本地安装与 Docker 最佳实践
运维·spring boot·docker
FungLeo2 天前
FengCMS·PHP+MySQL 升级实录 ·本地容器环境设计:只读挂载、LOCAL_UID、数据卷权限
开发语言·mysql·docker·php·fengcms
Diligently_2 天前
第 05 篇|慢查询优化实战 —— 一条 SQL 的重构全过程
容器
cpolar技术支持3 天前
用一份 YAML 画出家里的网络拓扑:哪个口通公网、哪几个容器藏在内网,一张图摊开,再用 cpolar 在外网随时翻这份图
docker·网络拓扑·内网穿透·cpolar·yaml
赤生云电竞3 天前
算力调度系统架构实践:计费、配额与抢占策略设计——面向Kubernetes GPU集群的多租户治理
容器·系统架构·kubernetes
FriendshipT3 天前
YOLOE Docker 部署实战:三模式推理、掩码输出与跨图视觉的完整实现
运维·人工智能·python·深度学习·docker·容器
the局外人3 天前
Docker 部署:从镜像构建到容器上线
后端·docker·容器
方便面不加香菜3 天前
Docker Compose 文件 -- docker-compose.yml
spring cloud·docker·容器