描述:执行docker run -d nginx:latest或docker pull mysql命令失败
报错信息如下:
[root@node01 ~]# docker run -d nginx:latest
Unable to find image 'nginx:latest' locally
docker: Error response from daemon: Head "https://registry-1.docker.io/v2/library/nginx/manifests/latest": dial tcp: lookup registry-1.docker.io on 192.168.1.1:53: no such host.
See 'docker run --help'.
解决办法:
1) 配置静态IP
[root@node01 ~]#vim /etc/sysconfig/network-scripts/ifcfg-ens33
将BOOTPROTO="dhcp"
改为
BOOTPROTO="static"
添加如下配置:
IPADDR="192.168.16.129"
NETMASK="255.255.255.0"
DNS1="8.8.8.8"
DNS2="8.8.4.4"
GATEWAY="192.168.16.2"
2)修改resolv.conf
[root@node01 ~]# vim /etc/resolv.conf
# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4
3)添加国内镜像
vim /etc/docker/daemon.json
添加如下内容:
{
"registry-mirrors": ["https://s27w6kze.mirror.aliyuncs.com"]
}
4)重启docker
systemctl daemon-reload
systemctl restart docker文章来源:https://www.toymoban.com/news/detail-497549.html
文章来源地址https://www.toymoban.com/news/detail-497549.html
到了这里,关于dial tcp: lookup registry-1.docker.io on 192.168.10.1:53: no such host.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!