简体   繁体   English

使用谷歌云代码在 vscode 中指定本地 docker 容器注册表

[英]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.

相关问题 访问 Docker 文件中的 Google Cloud 注册表 - Access to Google Cloud registry in Docker file 如何将谷歌云应用程序凭据文件传递给 docker 容器 - How to pass google cloud application credentials file to docker container 谷歌云容器注册表错误:“无法触发构建:请求包含无效参数。” - google cloud container registry error: "Failed to trigger build: Request contains an invalid argument." 在 Google Build 执行构建期间将 Google Cloud 凭据传递到 Docker 容器? - Passing Google Cloud credentials into a Docker container during build performed by Google Build? 如何调试 docker 推送到谷歌云工件注册表错误“清单未知:未找到请求的实体。”? - How to debug docker push to google cloud artifacts registry error "manifest unknown: Requested entity was not found."? 如何通过 python 脚本在 Google 容器注册表 (GCR) 中列出 docker 图像? - How to list docker images in Google container registry (GCR) through python script? 如何在 GCP 上使用 Cloud Build 在 CI/CD 脚本中包含 Container Registry 漏洞扫描 - How to inlcude Container Registry vulnerability scans in the CI/CD script using Cloud Build on GCP Cloud Run 中 Docker 容器上的 POST 出现 405 错误 - 405 error for POST on Docker Container in Cloud Run Google Cloud Build & Docker “Cloud Builder” - 以前工作的构建现在提供 137 状态代码 - Google Cloud Build & Docker "Cloud Builder" - builds that previously worked now give 137 status code 云代码未使用 minikube docker 上下文 - Cloud Code isn't using minikube docker context
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM