来自 daemon 的错误响应: 获取 https://registry-1.docker.io/v2/ : 拨打 tcp: 查找 registry-1.docker.io 192.168.65.1:53: 没有这样的主机

我是新的码头工人。当我运行码头拉声纳我得到以下错误。

来自 daemon 的错误响应: 获取 https://registry-1.docker.io/v2/: 拨号 TCP: 在192.168.65.1:53上的查找 registry-1.docker.io : 没有这样的主机

你能告诉我为什么我会得到这个错误,我怎样才能纠正这个错误。

175984 次浏览

I had similar issue on Ubuntu 16.04 and manage to solve it by adding more nameservers

You can try too.

  1. Open config file sudo nano /etc/resolv.conf and add the following under existing nameservers

    nameserver 8.8.8.8

    nameserver 8.8.4.4

  2. run following commands to restart daemon and docker service

    sudo systemctl daemon-reload

    sudo systemctl restart docker

Now try to pull image you want docker pull sonarqube

In my case on a Mac, only a restart of the docker-machine did the work:

docker-machine restart

Uninstalling docker did not work! Just the above restart is enough!

If your machine are located within the Great China area or using related Virtual Server, add Registry Mirrors to help your bypass the complex network router.

Or your can set a http_proxy for your docker configuration, referencing this link: https://docs.docker.com/config/daemon/systemd/#httphttps-proxy

sudo vi /etc/resolv.conf

And change nameserver to 8.8.8.8

In China, Add 114.114.114.114 to resolv.conf fixed it. sudo echo "nameserver 114.114.114.114" >> /etc/resolv.conf

I was getting the same error. Tried a few things like restarting the server, checking configuration etc... Finally, it got resolved by adding proxies (since I was using it inside my organization network)

I had the same issue, for me I was behind my office proxy and docker was not picking up the proxy set for terminal. To fix this, i have to set the proxy in docker settings window, which can be accessed from

task bar -> docker -> settings enter image description here

You need to add to your /etc/hosts in terminal write

$ sudo nano /etc/hosts

add below line and save it, try to run command and it will be working

34.228.211.243  registry-1.docker.io

I just restarted and it works fine again!

Things that might work: 1. Check your proxy settings 2. Restart docker 3. Go to your docker settings and check if you're signed in to docker hub, if you aren't, sign in and try again (This worked for me)

Had same issue, I restarted docker and it worked

make sure that your server is not located in the following areas:

Docker is a US company, we must comply with US export control regulations. In an
effort to comply with these, we now block all IP addresses that are located in Cuba,
Iran, North Korea, Republic of Crimea, Sudan, and Syria.

This could also be a DNS issue. Altering your nameservers will most likely resolve it, if is indeed related to your DNS.

You can verify the issue with: curl -vvv https://registry-1.docker.io/v2/ for a more detailed path.

If you are on ubuntu 18.04 or higher /etc/resolve.conf won't do the trick, they moved network management to NetPlan configs.

Add the google nameservers to your configuration (8.8.8.8 and 8.8.4.4)

find your network adapter name with ip a

network:
version: 2
renderer: NetworkManager
ethernets:
[network adapter name]:
addresses: ...
gateway4: ...
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4
search: []

And run sudo netplan apply

It happens when you are not logged in too, it happened to me. Problem gone after I logged in

I was able to solve this issue, by logging into docker.

sudo docker login
Enter your login credentials
sudo docker pull 'yourImageName'


I was able to resolve by running the below command.

sudo systemctl restart docker

in windows, just restart the docker, it worked for me. Go to Docker Desktop dashboard, click on the icon with setting icon and click restart

I got the same error & I solved it by executing the below-mentioned commands, If you are working on the windows version, you can try these commands Steps to be followed : Open the command prompt & execute these commands,

set http_proxy="http://user:pwd@proxyurl.com:port"


set https_proxy="https://user:pwd@proxy-url.com:port"

Disable experiment features and try again does the trick. Otherwise add the config below to daemon.json

"dns": [
"8.8.8.8",
"8.8.4.4"
]

I had the same problem, for me it was ACR repository name that I have misspelled. Maybe check your variables. I used it within Github Actions in the secret sections.

I had this same issue with a different solution. The issue was that the internet wasn't connected. That's another thing to check if none of these fix it for you!

A restart of your internet connection might solve this.

Executing docker as root fixed this for me. Like this: sudo docker pull foo/bar

My issue was tha ti was behind a corporate proxy and hence i was unable to reach the registry-1.docker.io.

Solution:

I bypassed this URL registry-1.docker.io in the proxy server for following

  1. SSL bypass
  2. Authentication Bypass.

Then i configured the proxy settings in docker.service file in RHEL server as

Environment="HTTP_PROXY=http://proxy.example.com:80"
Environment="HTTPS_PROXY=http://proxy.example.com:443"
NO_PROXY=“tnd-harbor.india.airtel.itm,10.241.99.232,
registry-1.docker.io/v2/”

Make sure the HTTPS_PROXY protocol is http.

By doing this i was able to fetch images.