我试图在Gitlab管道中提取和推送图像,避免使用对接方式,所以我尝试使用skopeo。
但是现在我在gcr上对skopeo进行身份验证时遇到了问题,因为我们使用了服务帐户的密钥身份验证,这似乎不被skopeo所支持(至少我无法让它工作),而且我们不想为此使用用户和密码。
错误信息是这样的:
unable to retrieve auth token: invalid username/password: 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为了使身份验证工作,我可以探索哪些可能性?
发布于 2022-09-27 16:58:58
我刚刚找到了解决该身份验证问题的方法,我们必须使用--dest-registry-token标志,如下所示:
skopeo copy --dest-registry-token "$(gcloud auth print-access-token)" docker://nginx:1.23.1 docker://us.gcr.io/project/nginx:1.23.1并确保在此之前激活服务帐户。
gcloud auth activate-service-account --key-file $SOME_FILEhttps://stackoverflow.com/questions/73870950
复制相似问题