首页 > 解决方案 > 创建 Pod 时图像拉取失败

问题描述

只是在本地机器上测试。Windows 7 x64、Minikube 1.14、docker 工具箱。
$docker image ls确实显示了我想使用的图像。

REPOSITORY myname/hello-service  
TAG 0.0.6  
IMAGE ID xxxxxxxxxxx  

在我的 Pod yaml 中:

spec:
  containers:
  -name: my-pod
   image: myname/hello-service:0.0.6

运行后$kubectl create -f pod.yaml。它失败了

Error: ImagePullBackOff
Failed to pull image "xxxxx" rpc error: code = ... manifest for myname/hello-service:0.0.6 not found

但是以前的版本 :0.0.5 工作得很好。
这两个图像都是在我的机器上构建的,并存储在 docker 的“默认”中。

标签: dockerkubectlminikube

解决方案


可能myname/hello-service:0.0.6仅在您的Windows主机上吗?如果是这样,minikube 找不到它。

您可以在 Minikube 中访问一些选项。其中之一是使用 minikube 的 Docker 守护程序构建本地映像。另一个是运行一个私有的本地 Docker 注册表。

我发现的一些例子和更多例子[这里描述得很好]。(https://www.edureka.co/community/17481/local-docker-image-on-minikube


推荐阅读