[英]Specifying local docker container registry in vscode using Google Cloud code
I am trying to use a local docker container registry as my imageRegistry.我正在尝试使用本地 docker 容器注册表作为我的 imageRegistry。 I created a registry by -我创建了一个注册表 -
docker run –d –p 5000:5000 –-name registry registry:2
I have tagged and pushed my image to localhost:5000, and I can see it running by docker images.我已将我的图像标记并推送到 localhost:5000,我可以看到它正在运行 docker 个图像。
I have modified my launch.json as -我已将 launch.json 修改为 -
{ "configurations": [ { "name": "Run/Debug on Kube.netes", "type": "cloudcode.kube.netes", "request": "launch", "skaffoldConfig": "${workspaceFolder}/skaffold.yaml", "watch": true, "cleanUp": true, "portForward": true, "imageRegistry": "localhost:5000" } ] }
But when I do a Run on Kube.netes,但是当我在 Kube.netes 上运行时,
I get an error waiting for rollout to finish: 0 of 1 updated replicas are available... pod/serviceb-847d79694c-6lxbd: container server is waiting to start: localhost:5000/serviceb:latest@sha256:*** can't be pulled.
I'm guessing you are using a local cluster solution such as minikube, Docker's built-in Kube.netes cluster, kind, microk8s, or k3s.我猜你正在使用本地集群解决方案,例如 minikube、Docker 内置的 Kube.netes 集群、kind、microk8s 或 k3s。 Although these clusters are running on your machine, they're running within a virtual machine and so their localhost
is the VM, not your machine.尽管这些集群在您的机器上运行,但它们在虚拟机中运行,因此它们的localhost
是虚拟机,而不是您的机器。 So your private registry is not accessible within the cluster.因此您的私有注册表在集群内不可访问。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.