简体   繁体   English

无法从 Google Compute Engine 访问 Google Container Registry

[英]Cannot access Google Container Registry from Google Compute Engine

I'm at my wits trying to get Docker images from Google Container Registry onto a Google Compute Engine instance.我正在尝试将 Docker 映像从 Google Container Registry 获取到 Google Compute Engine 实例上。 (The images I need have been successfully uploaded to GCR.) (我需要的图片已经成功上传到GCR。)

  1. I've logged in using gcloud auth login and then tried gcloud docker pull -- us.gcr.io/app-999/app which results in ERROR: (gcloud.docker) Docker is not installed.我已经使用gcloud auth login ,然后尝试gcloud docker pull -- us.gcr.io/app-999/app这导致ERROR: (gcloud.docker) Docker is not installed. . .

  2. I've tried to authenticate using oauth and pulling via a normal docker call.我尝试使用oauth进行身份验证并通过普通的 docker 调用进行拉取。 I see my credentials when I look at the file at .docker/config.json .当我查看.docker/config.json中的文件时,我会看到我的凭据。 Doing that, it looks like it's going to work, but ultimatly ends like this:这样做,看起来它会起作用,但最终会像这样结束:

    mbname@instance-1 ~ $ docker pull -- us.gcr.io/app-999/app Using default tag: latest latest: Pulling from app-999/app b7f33cc0b48e: Pulling fs layer 43a564ae36a3: Pulling fs layer b294f0e7874b: Pulling fs layer eb34a236f836: Waiting error pulling image configuration: unauthorized: authentication required

which looks like progress, because at least it attempted to download something.这看起来像是进步,因为至少它试图下载一些东西。

I've tried both of these things on my local machine as well and both methods were successful.我也在我的本地机器上尝试了这两种方法,两种方法都成功了。

Am I missing something?我错过了什么吗?

Thanks for your help.谢谢你的帮助。

PS I've also tried loading a container from another registry ( Docker Hub) and that worked fine, but I need more than one container and want to keep expenses down. PS 我还尝试从另一个注册表(Docker Hub)加载一个容器,效果很好,但我需要多个容器,并希望降低费用。

After contacting Google support they informed me that there is a bug in the CoreOS gcloud alias.联系 Google 支持后,他们通知我gcloud别名中存在错误。 This bug is fixed by overwriting the alias in the shell as follows:这个错误是通过覆盖 shell 中的别名来修复的,如下所示:

alias gcloud='(docker images google/cloud-sdk || docker pull google/cloud-sdk) > /dev/null;docker run -t -i --net=host -v $HOME/.config:/.config -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker google/cloud-sdk gcloud'

I've tried this and it works now.我已经试过了,现在可以用了。

docker should be included in the latest versions of gcloud . docker应包括在最新版本的gcloud You can update to the latest version of gcloud by running gcloud components update您可以通过运行gcloud components update更新到最新版本的gcloud

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从 Google Container Registry 自动将新容器部署到 Google Cloud Compute Engine - Automatically deploy new container to Google Cloud Compute Engine from Google Container Registry 验证 Google Compute Engine (GCE) 以从 Google Container Registry (GCR) 中提取图像 - Authenticate Google Compute Engine (GCE) to Pull Image from Google Container Registry (GCR) Google容器引擎在从容器注册表中提取图像时遇到问题 - google container engine having problems pulling image from container registry 有没有办法将容器从 docker hub 直接部署到谷歌计算引擎? - Is there a way to directly deploy a container from docker hub to google compute engine? Google计算和服务帐户用于注册表访问 - Google compute and servicce account for registry access 从另一个 GCP 项目将 Google Container Registry 容器拉入 Google Kubernetes 引擎 - Pulling a Google Container Registry container into Google Kubernetes Engine from another GCP project 无法在 Google Compute Engine 上部署容器映像 - Unable to deploy container images on Google Compute Engine GCP - 无法将 docker 图像从 Compute Engine 推送到 Container Registry - GCP - Not able to Push docker image from Compute Engine to Container Registry 无法使用没有外部 IP 地址的容器映像创建 Google Compute Engine VM - Cannot create a Google Compute Engine VM with a container image without en external IP address Google Compute Engine:无法通过 http 请求访问正在运行的 Docker 容器 - Google Compute Engine: Can't access running Docker container through http request
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM