解决docker search influxdb 报错Error response from daemon: Get "https://index.docker.io/v1/search?q=influxdb&n=25": dial tcp: lookup index.docker.io on 192.168.12.2:53: read udp 192.168.12.128:39189->

解决docker search influxdb 报错Error response from daemon: Get "https://index.docker.io/v1/search?q=influxdb&n=25": dial tcp: lookup index.docker.io on 192.168.12.2:53: read udp 192.168.12.128:39189->192.168.12.2:53: i/o timeout

docker pull && docker search出现:Error response from daemon: Get https://index.docker.io/v1/search?q=nginx&n=25: dial tcp: lookup index.docker.io on 172.16.16.2:53: read udp 172.16.16.23:44580->172.16.16.2:53: i/o timeout此类报错
如图:
image

解决方法一:
这个是因为dns域名没有解析的原因,编辑/etc/resolv.conf 文件,增加一行dns地址,例如:nameserver 8.8.4.4
类似这种:

解决方法二:
也可直接在hosts文件里添加解析,从 dig返回的ip随便选个加进hosts文件:

[root@docker ~]# dig @114.114.114.114 index.docker.io
image

/etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

18.215.138.58 index.docker.io
52.1.184.176 index.docker.io
34.194.164.123 index.docker.io

然后在进行docker pull & docker search influxdb就可以了
————————————————

posted @ 2023-05-13 23:06  热爱技术的小牛  阅读(1101)  评论(0编辑  收藏  举报
热爱技术的小牛