作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的示例问题是 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
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
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
28e260baaf1b: Waiting
556c5fb0d91b: Waiting
denied: Token exchange failed for project 'gcr-project'. Please enable Google Container Registry API in Cloud Console at https://console.cloud.google.com/apis/api/containerregistry.googleapis.com/overview?project=gcr-project before performing this operation.
me@cloudshell:~ (gcr-project-XXXXXX)$
Error response from daemon: 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
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
sudo snap install google-cloud-sdk --classic
进行了全新安装,按照文档做了所有其他的事情,但仍然有完全相同的问题。所以我认为这是一个 linux google cloud SDK 特定问题。
最佳答案
我能够在多台 ubuntu 机器上复制这个问题。我在最近的云 SDK 更新 (276.0.0) 后再次尝试,但没有成功。
最后我使用了 json key 文件 authentincati described in the docs here作为一种工作正常的解决方法。
关于google-container-registry - 无法推送到 Google Container Registry - 权限问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59599316/
我是一名优秀的程序员,十分优秀!