4.6.3 Setting the Default Registry

By default, the Docker Engine is configured to pull images directly from the Docker Hub if no additional registries have been defined.

It is possible to change the default registry by setting the default-registry option in /etc/docker/daemon.json.

  "default-registry": "test.registry.com",

Finally, restart the Docker Engine service:

# systemctl restart docker

When the default registry is changed, image references within the Docker Engine for images that have been pulled from the Docker Hub are updated to correctly display the docker.io prefix. For example nginx:latest is updated to reflect docker.io/nginx:latest. Images from the new default registry are displayed without a prefix.

The default registry determines the last possible registry that Docker Engine checks when you search for or pull an image. If you have configured multiple registries using the add-registry option then those registries are checked in sequential order, and if an image is not found in any of the other registries that you have been configured then the default registry is always used as the final option.