docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp 44.207.51.64:443: connect: network is unreachable.
刚装的docker,准备拉取个hello-world来试试的,结果报了这错误
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp 44.207.51.64:443: connect: network is unreachable.
百度到的解决方法如下
vim /etc/sysconfig/network-scripts/ifcfg-ens33
# 或
vim /etc/sysconfig/network-scripts/ifcfg-ens33
加上DNS1=8.8.8.8
然后重启网络systemctl restart network
执行docker pull hello-world
[root@echohye network-scripts]# docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:2498fce14358aa50ead0cc6c19990fc6ff866ce72aeb5546e1d59caac3d0d60f
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest
附配置说明
TYPE=Ethernet #网卡类型:为以太网
PROXY_ METHOD=none #代理方式:关闭状态
BROWSER_ ONLY=no #只是浏览器:否
BOOTPROTO=static #网卡协议DHCP动态主机配置协议
DEFROUTE=yes #默认路由:是
IPV4_ FAILURE_ FATAL=no #否开启IPV4致命错误检测:否
PV6INIT=yes # IPV6是否自动初始化:是
IPV6_ AUTOCONF="yes"IPV6是否自动配置:是
IPV6_ ADDR _GEN _MODE=stable- privacy # IPV6地址生成模型
stable-privacy是一种生成IPV6的策略
NAME=ens33 #网卡名字(与DEVICE- 致)
UUID=6ac17c2b-473e- -4894-811b-4940ee7bf455#唯一标识码
DEVICE=ens33#网卡设备
ONBOOT=yes #否激活网卡
IPADDR=192.168.1.11#ip地址(static设置 )
NETMASK=255.255.255.0#子网掩码
GATEWAY= 192.168.20.2#网关
DNS1=114.114.114.114#dns地址解析