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
相关推荐
Patrick_Wilson2 天前
从「改个端口」到 502:Next.js on k8s 的容器端口、Service 映射与 env 覆盖
docker·kubernetes·next.js
Suroy2 天前
DockerView-Go:用 Go 写一个终端 Docker 监控工具,顺便做了个 Web 仪表盘
docker
云恒要逆袭2 天前
运行你的第一个Docker容器
后端·docker·容器
宋均浩3 天前
# Docker 镜像瘦身实战:从 1.2G 到 80MB 的五个优化步骤
ci/cd·docker
程序员老赵4 天前
10 分钟部署 OpenCode:Docker 一键安装,浏览器打开就能用 AI 写代码(附完整命令与排错)
docker·容器·ai编程
WangMingHua1114 天前
LM Studio Docker 部署——本地大模型一键启动
docker
曲幽5 天前
别再用网页翻译看源码了!你的私人翻译神器LibreTranslate,部署避坑指南来了
python·docker·web·pot·translate·libretranslate·arogstranslate
武子康7 天前
调查研究-183 Apple container:Mac 上用轻量 VM 跑 Linux 容器,Swift 会改写本地容器体验吗?
docker·容器·apple
Alsn8610 天前
等待学习-学习目录:Docker 容器安全攻防
学习·安全·docker
2601_9618752410 天前
决战申论100题2026|最新|范文
linux·容器·centos·debian·ssh·fabric·vagrant