docker search tomcat
Error response from daemon: Get https://index.docker.io/v1/search?q=tomcat&n=25: dial tcp: lookup index.docker.io: no such host
執行docker search xxx
出現Error response from daemon
異常時,一般是鏡像加速地址配置的問題,如果已經配置過加速還是如上問題,多配置幾個加速地址:
vi /etc/docker/daemon.json
#添加如下內容
{
"registry-mirrors": ["http://hub-mirror.c.163.com","http://hub-mirror.c.163.com","https://registry.docker-cn.com"]
}
重啓docker服務:
service docker restart
如果還是不起作用,可能是DNS解析的問題:
修改服務器DNS網絡配置:
vi /etc/resolv.conf
將自己網絡的DNS地址追加到尾部:
查看網絡的DNS:
將圖中DNS地址追加到文件中
nameserver 10.xx.x.xxx
nameserver 10.xx.x.xxx
修改完成後重啓網絡服務
systemctl restart network