dockerkubernetesdocker-registrycontainer-registrydocker-registry-mirror

Can we change kubernetes image registry search list?


For example, I have an internal docker registry for my kube cluster, hosted on internal-docker-registry.io:5000.

When the pod from the kube cluster pulling image busybox, I don't want to pull from docker hub docker.io. But instead I want it to pull from internal-docker-registry.io:5000.

Note that I cannot change the image name to internal-docker-registry.io:5000/busybox since I don't own the spec and there are too man these kind of third party image in my cluster.


Solution

  • I have posted community wiki answer to summarize the topic:

    As David Maze well mentioned in the comment:

    there is no "image registry search list"; an image name without a registry always uses docker.io, to avoid surprises where e.g. FROM ubuntu means something different depending on local configuration.

    So if you can't change the image name to internal-docker-registry.io:5000/busybox then unfortunately you don't have the option to get the image from your private registry (according to David's comment).

    See also similar questions:

    How to change the default docker registry from docker.io to my private registry?

    How to change default K8s cluster registry?