小編給大家分享一下Docker怎么獲取鏡像報(bào)錯(cuò)docker: Error response from daemon,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
創(chuàng)新互聯(lián)主營宜君網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,app軟件定制開發(fā),宜君h5微信小程序搭建,宜君網(wǎng)站營銷推廣歡迎宜君等地區(qū)企業(yè)咨詢
在使用docker獲取鏡像時(shí),出現(xiàn)了鏡像獲取報(bào)錯(cuò)的問題,找到了解決的方法記一下。
一、問題
? ~ 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
強(qiáng)制docker.io
相關(guān)的域名解析到其它可用IP
54.164.230.151 registry-1.docker.io
保存之后重試:
? ~ docker search sameersbn
我們可看到,已經(jīng)可以獲取數(shù)據(jù)了。
三、使用docker國內(nèi)鏡像
使用 DaoCloud 提供的鏡像
Docker For Mac
右鍵點(diǎn)擊桌面頂欄的 docker 圖標(biāo),選擇 Preferences ,在 Daemon 標(biāo)簽(Docker 17.03 之前版本為 Advanced 標(biāo)簽)下的 Registry mirrors 列表中加入下面的鏡像地址:
http://141e5461.m.daocloud.io
點(diǎn)擊 Apply & Restart
按鈕使設(shè)置生效。
看完了這篇文章,相信你對(duì)“Docker怎么獲取鏡像報(bào)錯(cuò)docker: Error response from daemon”有了一定的了解,如果想了解更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!