docker-install icon indicating copy to clipboard operation
docker-install copied to clipboard

Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on XXX.XXX.XXX.XXX:53: read udp YYY.YYY.YYY.YYY:NNNNN->XXX.XXX.XXX.XXX:53: i/o timeout

Open frederico-klein opened this issue 3 years ago • 1 comments

Maybe this is more of a stackoverflow question

Hi, I am having a similar (message is different, I get a timeout instead of a no such host) issue as

https://stackoverflow.com/questions/47580528/error-response-from-daemon-get-https-registry-1-docker-io-v2-dial-tcp-look

But when running docker rootless.

My home directory is mounted from an external location, so I need to reload the service files to get it started - maybe handling this would be an improvement? I haven't enabled lingering, so maybe that could help (??). Either case, this doesn't really matter; I am only mentioning it because it might be related. I haven't tried using it the without systemd option.

To actually launch the service I need to do

$ systemctl daemon-reload --user

then I can start dockerd with

$ systemctl --user start docker

But I still can't do docker login, for instance (I get the message above, same when trying to do docker pull hello-world ). I've created a daemon.json file in ~/.config/docker and adding google's 8.8.8.8 dns, then restarting it, but this also didn't seem to have any effect.

$ cat ~/.config/docker/daemon.json
{
    "debug":true,
    "dns": [
    "8.8.8.8",
    "8.8.4.4"
    ]
}

Docker however seems to be actually working (at least hello-world shows me the hello message), if I copy the image from another pc and use docker load (like this https://www.digitalocean.com/community/questions/how-to-copy-a-docker-image-from-one-server-to-another-without-pushing-it-to-a-repository-first)

If I do curl -vvv https://registry-1.docker.io/v2/ on 2 pcs, one which can login and on the other with rootless docker, they both give the same message of 401 Unauthorized, but which means they both can see the host.

Another issue from coredns https://github.com/coredns/coredns/issues/2693 mentions in Debian systems (my case) to use:

update-alternatives --set iptables /usr/sbin/iptables-legacy
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
update-alternatives --set arptables /usr/sbin/arptables-legacy
update-alternatives --set ebtables /usr/sbin/ebtables-legacy

Not exactly the option I wanted to go with (also I have 2 debian systems one working with rootful docker and they both have the same alternative configs using the -nft versions); I can ask the sysadmin to try this for me, but I would rather not.

I mean, I think I can run docker (if I don't mind using another host to get images, rsyncing and then loading them onto the other machine), but I wish I could get this sorted.

Any suggestions?

frederico-klein avatar Aug 31 '22 08:08 frederico-klein

Error response from daemon: Get "https://****/v2/": dial tcp: lookup ****: no such host
i cant push image to hub jenkins show me this error

ibtissame-oumahrir avatar Apr 12 '23 13:04 ibtissame-oumahrir

This ticket looks off-topic for this issue tracker, and from the looks of it something related to networking in your environment. The curl -vvv https://registry-1.docker.io/v2/ returning an error is expected, as the /v2/ endpoint is (as part of the specification) meant for feature-discovery and returns whether authentication is needed for a given registry. In this case, the response includes where to authenticate;

< HTTP/1.1 401 Unauthorized
< content-type: application/json
< docker-distribution-api-version: registry/2.0
< www-authenticate: Bearer realm="https://auth.docker.io/token",service="registry.docker.io"
< date: Sat, 20 Jul 2024 14:25:09 GMT
< content-length: 87
< strict-transport-security: max-age=31536000
<
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}
* Connection #0 to host registry-1.docker.io left intact

Docker Hub does not allow unauthenticated requests (but authentication headers do not require a logged-in user); if you want to replicate an image-pull with cURL, there's a script in the moby repository that does this (it's used in CI in that repository, but definitely not recommended for other purposes, other than learning how the mechanics work); https://github.com/moby/moby/blob/733755d7cb18a4dbea7c290cc56e61d05502aca0/contrib/download-frozen-image-v2.sh#L184-L187

I'm closing this ticket as off-topic for this issue tracker, and because this GitHub issue tracker is not intended as a general support, consider using one of;

but feel free to continue the conversation

thaJeztah avatar Jul 20 '24 14:07 thaJeztah