[英]Auth error when pushing to Google Artifact Repository
I'm trying to push to GAR from my local machine, but I always get this error:我正在尝试从本地机器推送到 GAR,但我总是收到此错误:
failed to authorize: failed to fetch anonymous token: unexpected status: 403 Forbidden
First, I've confirmed that my account has the Artifact Registry Writer role through IAM.首先,我已通过 IAM 确认我的账户具有 Artifact Registry Writer 角色。
I have done the following locally:我在本地做了以下事情:
# Login with my Google account
gcloud auth login --update-adc --force
# Configure docker to use the gcloud CLI auth helper
gcloud auth configure-docker us-west1-docker.pkg.dev
# docker login for good measure
docker login
# Tag my image (already built)
docker tag myimage us-west1-docker.pkg.dev/myproject/myrepo/myimage
# Push it
docker push us-west1-docker.pkg.dev/myproject/myrepo/myimage
On this final command I get the error above.在这个最终命令上,我得到了上面的错误。
I have read all the Google documentation I could find but they all suggest the above steps:我已经阅读了我能找到的所有谷歌文档,但它们都建议了上述步骤:
Note: I can't pull either, using the command provided directly from the GCP web UI.注意:我也不能拉,使用直接从 GCP web UI 提供的命令。
I'm on M1 Mac.我在 M1 Mac 上。
So I was able to solve this problem by completely nuking Docker, specifically with these steps: https://stackoverflow.com/a/69437543/3846032 .因此,我能够通过完全消除 Docker 来解决这个问题,特别是通过以下步骤: https://stackoverflow.com/a/69437543/3846032 。 I couldn't uninstall it by normal means, it would just hang, implying that the problems I was getting were a result of my Docker installation being very broken.
我无法通过正常方式卸载它,它只会挂起,这意味着我遇到的问题是我的 Docker 安装非常损坏的结果。 Indeed, I managed to follow the above steps on another machine and it worked, which led me to conclude the steps above and my credentials were totally fine.
事实上,我设法在另一台机器上按照上述步骤操作并且它工作正常,这使我得出上述步骤并且我的凭据完全没问题。
The 403 was a red herring, it must have come from my local Docker being broken in such a way that it doesn't send properly authenticated requests. 403 是一个红鲱鱼,它一定来自我当地的 Docker 被破坏,以至于它没有发送经过正确身份验证的请求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.