11

I am refering to this link - Docker pull.

By default, docker pull pulls images from Docker Hub (https://hub.docker.com).

enter image description here

I would like to know where this link is configured on our local machine setup. I am using Docker on Windows 10.

6
  • 1
  • The linked dupe is old, but it looks like this still hasn't been implemented: github.com/moby/moby/pull/34319
    – SiHa
    Dec 19, 2018 at 8:30
  • @SiHa I didn't get any reference where default registry is configured at the given SO link. Can you point me to the same?
    – asg
    Dec 19, 2018 at 8:36
  • 1
    I think the point is that it isn't configured anywhere. The only reason that I can think that you might want the information is to be able to change it, and the dupe link pretty clearly states that you can't change it.
    – SiHa
    Dec 19, 2018 at 8:43
  • "I think the point is that it isn't configured anywhere" - How it's possible? It must be getting reference from somewhere.. right? I am not looking the change the same while pulling the image.. I am more interested in it's location.
    – asg
    Dec 19, 2018 at 8:46

1 Answer 1

16

You cannot change the default domain of a docker image. This is by design:

Your Docker installation with this "private registry defined in the config file" would be incompatible with every other Docker installation out there. Running docker pull debian needs to pull from the same place on every Docker install.

A developer using Docker on their box will use debian, centos and ubuntu official images. Your hacked up Docker install would just serve your own versions of those images (if they're present) and this will break things.

You should identify your image through the full URL:

<your-private-registry>/<repository>/<image>:<tag>

The default domain docker.io (the "docker hub") is hardcoded in docker's code. For example here:

https://github.com/docker/distribution/blob/master/reference/normalize.go

Check the function splitDockerDomain which sets docker.io as registry if it's not provided by the user.

3
  • 1
    Thanks for the information but this is what I am not looking for. I would like to know - From where does Docker picks up - hub.docker.com as a default registry? Where it is configured - in a JSON file, JAR file, .exe file etc.. I hope I am clear on my question.
    – asg
    Dec 19, 2018 at 10:13
  • 3
    It picks it up directly from the code. Check the file I linked in the end of my answer. If you read through the code of normalize.go you'll find the docker.io-URL hardcoded there. docker.io points to the "technical" interface of hub.docker.com. Maybe this is of interest to you. Dec 19, 2018 at 10:19
  • 5
    Now I understand why RedHat discontinued support for Docker. This way of thinking is totally incompatible with corporate environments.
    – ibre5041
    Sep 3, 2020 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.