资源上的权限“artifactregistry.repositories.downloadArtifacts”被拒绝

2023-12-30

虽然工件存储库已成功创建,但即使向我在 gcloud cli 上使用的会计授予所有工件权限后,运行 docker Push 将图像推送到 google 工件注册表也会失败并出现权限错误。

推送图片的命令:

docker push us-central1-docker.pkg.dev/project-id/repo-name:v2

错误信息:

The push refers to repository [us-central1-docker.pkg.dev/project-id/repo-name]
6f6f4a472f31: Preparing
bc096d7549c4: Preparing
5f70bf18a086: Preparing
20bed28d4def: Preparing
2a3255c6d9fb: Preparing
3f5d38b4936d: Waiting
7be8268e2fb0: Waiting
b889a93a79dd: Waiting
9d4550089a93: Waiting
a7934564e6b9: Waiting
1b7cceb6a07c: Waiting
b274e8788e0c: Waiting
78658088978a: Waiting
denied: Permission "artifactregistry.repositories.downloadArtifacts" denied on resource "projects/project-id/locations/us-central1/repositories/repo-name" (or it may not exist)



我能够重新创建您的用例。当您尝试将图像推送到repository其中其特定主机名(与其存储库位置关联)尚未添加到用于身份验证的凭据帮助程序配置中。你可以参考这个为 Docker 设置身份验证 https://cloud.google.com/artifact-registry/docs/docker/authentication@DazWilkin 在评论中也提供了更多详细信息。

In my example, I was trying to push an image on a repository that has a location of us-east1 and got the same error since it is not yet added to the credential helper configuration. enter image description here

在我使用以下命令运行身份验证后(特别是对于 us-east1,因为它是location我的存储库),图像已成功推送:

gcloud auth configure-docker us-east1-docker.pkg.dev

QUICK TIP: You may get your authentication command specific for your repository when you open your desired repository in the console https://console.cloud.google.com/artifacts, and then click on the SETUP INSTRUCTIONS. enter image description here

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

资源上的权限“artifactregistry.repositories.downloadArtifacts”被拒绝 的相关文章