相关疑难解决方法(0)

Google Container Registry 权限

我正在尝试将 docker 映像推送到 GCP,但我仍然收到此错误:

unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication
Run Code Online (Sandbox Code Playgroud)

我一步一步地遵循这个https://cloud.google.com/container-registry/docs/quickstart一切正常,直到 docker push

很明显 GCP 项目

我已经试过了:

  1. 使用 gcloud 作为 Docker 凭证助手: gcloud auth configure-docker
  2. 重新安装 Cloud SDK 和 gcloud init
  3. 存储管理员角色添加到我的帐户

我做错了什么?

感谢您的任何建议

permissions docker google-cloud-platform google-container-registry

3
推荐指数
1
解决办法
2612
查看次数

无法推送到 Google Container Registry - 权限问题

我的样本问题是Vaclav。我已经按照 GCR 快速入门开始了这封信,其中需要创建一个新项目(称为 gcr-project)并复制 Flask(python)应用程序的代码。

构建docker镜像后,我输入了命令:

gcloud auth configure-docker
docker tag quickstart-image gcr.io/gcr-project/quickstart-image:tag1
docker push gcr.io/gcr-project/quickstart-image:tag1
Run Code Online (Sandbox Code Playgroud)

回应是:

unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication
Run Code Online (Sandbox Code Playgroud)

因此,很高兴知道问题是与凭据(我正在为其他项目使用云 SDK OK)还是权限有关。此处的文档建议您需要存储管理员权限,但项目已经拥有该权限,请参阅此处的屏幕截图

我很感激任何解决此问题的提示,因为我正在寻找使用 GCR 的方法,但这个问题对我来说很难。

更新: 我用云外壳尝试了相同的过程

me@cloudshell:~ (gcr-project-XXXXXX)$ docker push gcr.io/gcr-project/quickstart-image:tag1
The push refers to repository [gcr.io/gcr-project/quickstart-image]
4399528b7213: Preparing
1d10b1eeca74: Preparing
75156020d862: Preparing
c5697656a146: Preparing
2a435270de82: Preparing
c35f70b5c25a: Waiting …
Run Code Online (Sandbox Code Playgroud)

google-container-registry

3
推荐指数
1
解决办法
1917
查看次数