发布于 3年前

docker: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io: no such host.

在Ubuntu上执行docker pull拉取镜像报错:

docker: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io: no such host.

原因是解析不了域名,解析不了主机:registry-1.docker.io。

解决方法:

在/etc/resolv.conf添加dns:

vim /etc/resolv.conf

添加dns解析,如nameserver 8.8.4.4。完整如下:

# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
nameserver 8.8.4.4
options edns0
©2020 edoou.com   京ICP备16001874号-3