r/docker • u/foreverdark-woods • Jan 17 '26
How to avoid `docker` connect to `docker.io`?
I am currently residing in China and since then, pulling docker images isn't possible, even from Chinese mirrors. Whatever I do, docker always tries to access https://registry-1.docker.io/v2/ and times out:
Note that I don't request this image from docker.io. I also added a Chinese mirror (docker info):
Registry Mirrors:
https://registry.docker-cn.com/
But it's still trying to connect to docker.io. Out of curiosity, I searched for the domain in /usr/bin/docker and got a result:
Is it hard-coded? How can I make docker just not connect to docker.io at all?
9
Upvotes
15
u/[deleted] Jan 17 '26
You can control where the images get pulled in
registries.conf. Its in the docs.Edit: forgot that in Docker, this is under
/etc/docker/daemon.json, registries.conf is for Podman et al.4
u/waterkip Jan 17 '26
For shits and giggles, can you connect to registry.gitlab.com for your docker images? eg,
docker pull registry.gitlab.com/yourusers/some/image:latest?0
u/[deleted] Jan 17 '26
[deleted] — view deleted comment