Docker获取镜像报错docker: Error response from daemon
今天在使用docker获取镜像时,出现了镜像获取报错的问题,找到了解决的方法记一下。
一、问题
➜ ~ docker search sameersbn
error response from daemon: get https://index.docker.io/v1/search?q=sameersbn&n=25: dial tcp: lookup index.docker.io on 192.168.65.1:53: read udp 192.168.65.2:45190->192.168.65.1:53: i/o timeout➜ ~ docker pull sameersbn
using default tag: latest
error response from daemon: get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (client.timeout exceeded while awaiting headers)
➜ ~
二、处理
第一步:通过dig @114.114.114.114 registry-1.docker.io
找到可用ip
➜ ~ dig @114.114.114.114 registry-1.docker.io ; <<>> dig 9.8.3-p1 <<>> @114.114.114.114 registry-1.docker.io ; (1 server found) ;; global options: +cmd ;; got answer: ;; ->>header<<- opcode: query, status: noerror, id: 47220 ;; flags: qr rd ra; query: 1, answer: 8, authority: 4, additional: 9 ;; opt pseudosection: ; edns: version: 0, flags:; udp: 4096 ;; question section: ;registry-1.docker.io. in a ;; answer section: registry-1.docker.io. 3600 in a 54.164.230.151 registry-1.docker.io. 3600 in a 35.169.231.249 registry-1.docker.io. 3600 in a 34.205.207.96 registry-1.docker.io. 3600 in a 34.200.28.105 registry-1.docker.io. 3600 in a 52.204.202.231 registry-1.docker.io. 3600 in a 54.152.209.167 registry-1.docker.io. 3600 in a 52.22.181.254 registry-1.docker.io. 3600 in a 52.54.216.153 ;; authority section: docker.io. 61985 in ns ns-1827.awsdns-36.co.uk. docker.io. 61985 in ns ns-1168.awsdns-18.org. docker.io. 61985 in ns ns-513.awsdns-00.net. docker.io. 61985 in ns ns-421.awsdns-52.com. ;; additional section: ns-421.awsdns-52.com. 148245 in a 205.251.193.165 ns-421.awsdns-52.com. 149402 in aaaa 2600:9000:5301:a500::1 ns-513.awsdns-00.net. 149549 in a 205.251.194.1 ns-513.awsdns-00.net. 149549 in aaaa 2600:9000:5302:100::1 ns-1168.awsdns-18.org. 148917 in a 205.251.196.144 ns-1168.awsdns-18.org. 148917 in aaaa 2600:9000:5304:9000::1 ns-1827.awsdns-36.co.uk. 148040 in a 205.251.199.35 ns-1827.awsdns-36.co.uk. 148040 in aaaa 2600:9000:5307:2300::1 ;; query time: 60 msec ;; server: 114.114.114.114#53(114.114.114.114) ;; when: mon aug 20 22:36:29 2018 ;; msg size rcvd: 493
第二步:尝试修改/etc/hosts
强制docker.io
相关的域名解析到其它可用ip
54.164.230.151 registry-1.docker.io
保存之后重试:
➜ ~ docker search sameersbn
我们可看到,已经可以获取数据了。
三、使用docker国内镜像
使用 daocloud 提供的镜像
docker for mac
右键点击桌面顶栏的 docker 图标,选择 preferences ,在 daemon 标签(docker 17.03 之前版本为 advanced 标签)下的 registry mirrors 列表中加入下面的镜像地址:
http://141e5461.m.daocloud.io
点击 apply & restart
按钮使设置生效。
docker toolbox 等配置方法请参考帮助文档。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
上一篇: *星:区块链去中心化的2大技术基础
推荐阅读
-
Docker获取镜像报错docker: Error response from daemon
-
docker 安装 Error response from daemon: Cannot start container no such file or directory
-
[问题未处理]-docker报错stream copy error- reading from a closed fifo导致服务器oom并cpu飙升后无响应
-
Docker获取镜像报错docker: Error response from daemon
-
解决docker启动报错“Error starting daemon: SELinux is not supported with the overlay2 graph driver on this
-
Docker : docker: Error response from daemon: user specified IP address is supported on user defined
-
[问题未处理]-docker报错stream copy error- reading from a closed fifo导致服务器oom并cpu飙升后无响应
-
docker: Error response from daemon: Conflict.
-
docker swarm错误: Error response from daemon: rpc error: code = 4 desc = context deadline exceeded
-
docker遇到问题五:swarm 添加worker机报错,信息如“Error response from daemon: rpc error: code = Unavailable desc = ”