例如,我的 kube 集群有一个内部 docker 注册表,托管在 internal-docker-registry.io:5000
上。
当 pod 从 kube 集群拉取图像 busybox
时,我不想从 docker hub docker.io
拉取。但我希望它从 internal-docker-registry.io:5000
中提取。
请注意,我无法将图像名称更改为 internal-docker-registry.io:5000/busybox
,因为我不拥有该规范,而且有太多此类第三方我集群中的聚会图像。
最佳答案
我已经发布了社区 wiki 答案来总结主题:
作为David Maze评论中很好地提到:
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.
因此,如果您无法将镜像名称更改为 internal-docker-registry.io:5000/busybox,那么很遗憾,您无法从您的私有(private)注册表中获取镜像(根据 David 的评论)。
另见类似问题:
How to change the default docker registry from docker.io to my private registry?
关于docker - 我们可以更改 kubernetes 镜像注册表搜索列表吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69498046/