tighten / takeout

Docker-based development-only dependency manager. macOS, Linux, and WSL2-only and installs via PHP's Composer... for now.
MIT License
1.59k stars 83 forks source link

Connection refused trying to connect to registry-1.docker.io #209

Closed mattstauffer closed 3 years ago

mattstauffer commented 3 years ago

I know I'm a Takeout maintainer so I don't have to make this public, but I figure I'm not the only person who'll ever see this error, so I'll put it here publicly while I try to figure it out.

image

 ERR  Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.64.1:53: read udp 192.168.64.2:36267->192.168.64.1:53: read: connection refused

This is on an m1 laptop using the brand new Docker for desktop build, so first thing I'm going to do is install a Docker container the classic way not using takeout and I bet I'll have the same issue there. :)

mattstauffer commented 3 years ago

Yuuuuup.

image

Not a takeout issue, but when I find the solution I'll put it here anyway. :)

mattstauffer commented 3 years ago

These folks said restarting Docker fixed it, but sadly that didn't work:

https://forums.docker.com/t/error-response-from-daemon-get-https-registry-1-docker-io-v2/23741/26

Gonna try restarting my computer next just for fun. :)

mattstauffer commented 3 years ago

Restarting did not fix it. :/

dennisvandalen commented 3 years ago

@mattstauffer try stopping the dnsmasq service

mattstauffer commented 3 years ago

@dennisvandalen Thanks! Sadly that didn't work. Interestingly my dnsmasq services was in an error status, but stopping it didn't fix the problem.

mattstauffer commented 3 years ago

Thought it might be DNS related so I tried this, but no luck:

image

jasonvarga commented 3 years ago

I'm running into it, also running an M1. Here's the docker issue: https://github.com/docker/for-mac/issues/5186

At least for me, the workaround is this, in this order:

After you've enabled the container, you can turn dnsmasq back on. Running takeout start/stop seems to be fine without needing to disable dnsmasq once you've enabled the container.

mattstauffer commented 3 years ago

@jasonvarga Thank you! I tried stopping DNSMasq and it didn't work, but I'm gonna stop it and restart the machine shortly and test that out. Thank you for the link, too!

hcancelik commented 3 years ago

@jasonvarga Thank you! I tried stopping DNSMasq and it didn't work, but I'm gonna stop it and restart the machine shortly and test that out. Thank you for the link, too!

You just need to restart the docker after stopping dnsmasq. Also, double check that it's indeed stopped instead of failed.

mattstauffer commented 3 years ago

@hcancelik You're right! I had tried to restart it in the preferences, using "apply and restart" on some changes I was making, but that apparently didn't cut it; I actually had to click on the dropdown and click Restart, and then that fixed it.

Thanks!

image
mattstauffer commented 3 years ago

Thanks again @jasonvarga!

For anyone else who runs into this, this is a Docker for Mac + DNSMasq (likely installed by Laravel Valet) thing, not a Takeout thing.

https://github.com/docker/for-mac/issues/5186

zatorck commented 3 years ago

It's also worth to say that it's not only issue caused by dnsmasq. Also when You restart container with dnsmaqs turned on Docker cannot read date properly and set dates as 1970 in its containers.

dangoriya commented 5 months ago

user$ docker run hello-world Unable to find image 'hello-world:latest' locally docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp 54.236.113.205:443: connect: connection refused. user$ curl https://registry-1.docker.io/v2/ {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}

what might be the issue ?

nerazzurri0302 commented 3 months ago

reboot turns ok.