gcloud - Error pulling docker image from GCR: "You don't have the needed permissions to perform this operation, and you may have invalid credentials."
问题描述
I am SSH'd into a GCE instance in Project A whose service account has Storage Admin access in Project B, where Image Foo is located. When I run docker build . from the command line of my GCE instance, I get the above error when docker tries to pull Image Foo from Project B. I have configured docker according to the instructions in the link, and authenticated using gcloud.
解决方案
我怀疑这是两件事中的一两个:
首先,检查您在 VM 上运行的帐户 ( gcloud auth list
)。这可能是 VM 的服务帐户而不是您的用户帐户。这是需要 IAM'd 到存储桶的帐户;
其次,确保您已将 docker 配置为访问 GCR 的帐户凭据(如果可能:)gcloud auth configure-docker
。
然后,它应该工作。
我重现了您的错误并应用了这些更改并且它有效(链接)
推荐阅读
- laravel - 活跃用户未显示在实时聊天应用程序中
- r - 在小插图中引用 .Rd 文件
- qt - qt restapi后无反应
- r - data.frame 中一个变量的滚动总和,以另一个变量定义的步数计算
- oracle - 如果 PhpMyAdmin 支持 MYSQL,我如何将 Oracle 数据库插入到 PhpMyAdmin
- json - Flutter 家谱创建小部件
- r - 多个(动态指定)列上的“if_else”条件
- arrays - 使用带有指针的数组实现堆栈的 C 中的分段错误
- javascript - 无论查询字符串发生什么变化,都返回上一页
- java - 将工件部署到 Nexus 时找不到工件