情景还原: 用docker拉取jenkins最新版本 docker pull jenkins/jenkins:lts报了这个错误:

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

一通百度,发现原来是dns服务器的错误,把服务器改成8.8.8.8或者114.114.114.114即可

具体做法:

vim /etc/sysconfig/network-scripts/ifcfg-ens33    这里换成你自己的网卡

Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker_百度


vim /etc/resolv.conf 也加上这行

Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker_tcp/ip_02


重启网络,systemctl restart network

再来看下,ok啦:

大功告成!!