解决Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/问题

昨天在使用docker 时,将 image 文件从仓库抓取到本地一直报错,经过尝试,终于得以解决。

错误信息如下:

[root@archlinux ~]# docker image pull library/hello-world
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/latest: dial tcp 52.20.146.203:443: i/o timeout

或者:

[root@archlinux quanxj]# docker image pull library/hello-world
Using default tag: latest
latest: Pulling from library/hello-world
ca4f61b1923c: Pull complete
error pulling image configuration: Get https://registry-1.docker.io/v2/library/hello-world/blobs/sha256:f2a91732366c0332ccd7afd2a5c4ff2b9af81f549370f7a19acd460f87686bc7: dial tcp 35.169.231.249:443: i/o timeout

解决方法如下:

**第一步:**通过 dig @114.114.114.114 registry-1.docker.io找到可用IP

[root@archlinux ~]# dig @114.114.114.114 registry-1.docker.io
; <<>> DiG 9.12.0 <<>> @114.114.114.114 registry-1.docker.io
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37534
;; flags: qr rd ra; QUERY: 1, ANSWER: 8, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 88f87a15f4ca45dc (echoed)
;; QUESTION SECTION:
;registry-1.docker.io. IN A
;; ANSWER SECTION:
registry-1.docker.io. 30 IN A 34.200.28.105
registry-1.docker.io. 30 IN A 52.22.181.254
registry-1.docker.io. 30 IN A 35.169.231.249
registry-1.docker.io. 30 IN A 52.5.185.86
registry-1.docker.io. 30 IN A 54.164.230.151
registry-1.docker.io. 30 IN A 34.200.90.16
registry-1.docker.io. 30 IN A 52.20.146.203
registry-1.docker.io. 30 IN A 52.206.156.207
;; Query time: 116 msec
;; SERVER: 114.114.114.114#53(114.114.114.114)
;; WHEN: 四 3月 08 09:27:12 CST 2018
;; MSG SIZE rcvd: 189

第二步:尝试修改/etc/hosts强制docker.io相关的域名解析到其它可用IP

vim /etc/hosts

添加一个可用IP:

52.5.185.86 registry-1.docker.io

保存之后重试:

[root@archlinux quanxj]# docker image pull library/hello-world
Using default tag: latest
latest: Pulling from library/hello-world
ca4f61b1923c: Already exists
Digest: sha256:083de497cff944f969d8499ab94f07134c50bcf5e6b9559b27182d3fa80ce3f7
Status: Downloaded newer image for hello-world:latest

验证:

[root@archlinux quanxj]# docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest f2a91732366c 3 months ago 1.85kB

成功!

回答: 这个错误信息通常表示Docker无法连接到Docker镜像仓库。有几种可能的原因导致这个问题。首先,可能是网络连接问题,您可以尝试检查您的网络连接是否正常。其次,可能是DNS解析问题,您可以尝试修改resolv.conf文件中的nameserver来解决这个问题。另外,这个错误也可能是由于Docker镜像仓库的服务器问题引起的。如果是这种情况,您可以尝试等待一段时间后再次尝试。最后,如果您在拉取私有镜像或上传镜像时遇到这个问题,可能是因为您需要先进行Docker登录并提供凭证信息。请确保您已经正确登录并提供了正确的凭证信息。希望这些解决方法能够帮助您解决问题。\[1\]\[2\]\[3\] #### 引用[.reference_title] - *1* *3* [docker拉取镜像时报错:docker: Error response from daemon: Get “https://registry-1.docker.io/v2/“: ...](https://blog.csdn.net/qq_47354826/article/details/129090363)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [Error response from daemon: Get https://registry-1.docker.io/v2/ ... read: connection refused](https://blog.csdn.net/zy1314567/article/details/107378677)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值