3

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.

jack2684
  • 324
  • 3
  • 15
  • https://stackoverflow.com/questions/33054369/how-to-change-the-default-docker-registry-from-docker-io-to-my-private-registry – erik258 Oct 08 '21 at 15:09
  • 1
    See also [How to change default K8s cluster registry?](https://stackoverflow.com/questions/66026479/how-to-change-default-k8s-cluster-registry) which asks the same question. As the question @DanielFarrell mentions indicates, 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. – David Maze Oct 08 '21 at 15:44

2 Answers2

1

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?

Mikołaj Głodziak
  • 4,775
  • 7
  • 28
0

Here you can find a complete guide on how to accomplish this in the official kubernetes documentation [1]

[1] https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/