当前位置: 代码网 > it编程>开发工具>Docker > Docker pull镜像一直在Waiting无法下载,根本解决方法

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

2024年08月02日 Docker 我要评论
Docker pull镜像一直在Waiting无法下载,根本解决方法。

1、现象描述:

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

[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为例,直接操作哦:

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源,换成国内源

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、同步时间

####需安装ntp, 自行搜

ntpdate ntp1.aliyun.com

4、结果如下,6得很

[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

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com