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
相关推荐
虎头金猫4 天前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
分布式存储与RustFS4 天前
MinIO 官方 Docker 镜像被移除:依赖它的项目该怎么办
docker·云原生·devops·对象存储·minio·分布式存储
玉&心4 天前
通过Arthas在线诊断K8S中的内存及JVM等使用情况
docker·k8s·arthas
xing-xing4 天前
Docker容器中Nginx站点根目录网页配置访问
nginx·docker
赵文宇(温玉)5 天前
CoreDNS的hosts插件的缺行配置导致k8s集群异常
容器·kubernetes·rancher
guo_wen_qiang5 天前
上传本地镜像到harbor中
docker·容器·持续部署
羑悻的小杀马特5 天前
Dockerfile 全景指南:从入门编写dockerfile到生产环境镜像优化实战,一步步带你从啃透制作指令到镜像制作落地!
docker·dockerfile·镜像制作
BianHuanShiZhe5 天前
docker常见命令
docker
正经教主5 天前
【FDE系列】阶段2:Day 43:Docker Compose — 多容器一键编排
人工智能·docker·fde
忆~遂愿5 天前
本地片库怎么在外面打开?Plex + cpolar 搭一套可远程访问的私人影音库
docker·容器