Where Docker default registry URL is configured?

13,342

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.

Share:
13,342
asg
Author by

asg

Updated on June 12, 2022

Comments

  • asg
    asg about 2 years

    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.

  • asg
    asg over 5 years
    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.
  • Fabian Braun
    Fabian Braun over 5 years
    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.
  • ibre5041
    ibre5041 almost 4 years
    Now I understand why RedHat discontinued support for Docker. This way of thinking is totally incompatible with corporate environments.