gcp docker 推送 - 权限被拒绝

gcp docker push - permission denied

GCP VM 使用的默认服务帐户已被 g运行ted storage.buckets.*storage.objects.* 角色,但我收到 storage.buckets.create 权限不存在的错误设置。

denied: Token exchange failed for project 'test-307504'. Caller does not have permission 'storage.buckets.create'. To configure permissions, follow instructions at: https://cloud.google.com/container-registry/docs/access-control

默认服务帐户是 123456789-compute@developer.gserviceaccount.com,我已经创建了与存储相关的角色并分配给了 IAM 服务帐户,并且我 运行 命令 gcloud auth configure-docker。但我仍然无法将 docker 图像推送到 GCR 存储库。

在分配要在 VM 上刷新的角色后,我还应该做些什么吗?

除权限外,还要检查 VM 级别的 access scope
当你在的时候,也请阅读 Using the Compute Engine Default Service Account and Best Practices