New install Docker Desktop on new Mac, error from daemon - can't get from registry-1.docker.io

I’ve just installed Docker Desktop on Macbook Pro, M1, MacOS Ventura 13.3.1. I ran:
docker run -d -p 80:80 docker/getting-started
and got response:

Unable to find image 'docker/getting-started:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).

This fails too:
docker run --dns 192.10.0.2 busybox nslookup google.com
As does:
docker run busybox nslookup google.com

I’ve tried changing the nameserver in /etc/resolv.conf to 8.8.8.8, added

{
  "dns": ["8.8.8.8", "192.168.0.1"]
}

to ~/.docker/daemon.json - This prevented the engine from starting. I also tried the same with 1.1.1.1 instead of 8.8.8.8 but that didn’t work either.

I’ve turned off experimental features.
Reset to factory settings.
Purged all settings.
Tried 3 different wifi networks.
dnsmesq isn’t running.

The diagnostics said: everything passed except:

[FAIL] DD0038: is the connection to Docker working? HTTP GET https://login.docker.com: Get "https://login.docker.com": context deadline exceeded```

1 : The test: is the connection to Docker working?
Failed with: HTTP GET https://login.docker.com: Get “https://login.docker.com”: context deadline exceeded```

BUT: This worked:
docker run --dns 1.1.1.1 busybox nslookup google.com

So I changed nameserver to 1.1.1.1 in resolv.conf and now
docker run busybox nslookup google.com runs.

But docker run -d -p 80:80 docker/getting-started doesn’t still.

I’m at a loss. I’m new to Macs, I’m a Linux person. Thanks in advance.

Hello @linuxbearlen,
DNS should generally auto-populates based on your network ISP config.

if you still want to configure DNS on mac your you can do something like below

cat /etc/resolv.conf

#

# macOS Notice

#

# This file is not consulted for DNS hostname resolution, address

# resolution, or the DNS query routing mechanism used by most

# processes on this system.

#

# To view the DNS configuration used by this system, use:

# scutil --dns

#

# SEE ALSO

# dns-sd(1), scutil(8)

#

# This file is automatically generated.

#

nameserver 8.8.8.8

nameserver 172.20.10.1
nameserver 1.1.1.1

with the above config below the test output

docker run busybox nslookup google.com


Server:         192.168.65.7
Address:        192.168.65.7:53

Non-authoritative answer:
Name:   google.com
Address: 2a00:1450:400b:c00::71
Name:   google.com
Address: 2a00:1450:400b:c00::8b
Name:   google.com
Address: 2a00:1450:400b:c00::65
Name:   google.com
Address: 2a00:1450:400b:c00::64

Non-authoritative answer:
Name:   google.com
Address: 209.85.202.138
Name:   google.com
Address: 209.85.202.100
Name:   google.com
Address: 209.85.202.102
Name:   google.com
Address: 209.85.202.139
Name:   google.com
Address: 209.85.202.101
Name:   google.com
Address: 209.85.202.113

if this still does not work, I would suggest checking with your ISP.

Thanks

Thanks so much for your reply. I had already tried those settings into resolv.conf and it still wasn’t working. I have now fixed the issue by setting Google as the nameserver in the Settings/Network GUI. I added:

8.8.8.8
8.8.4.4
2001:4860:4860::8888
2001:4860:4860::8844

one line at a time into the GUI and it suddenly worked.

All fixed now, thanks!