谷歌云应用引擎部署失败

时间:2016-11-24 06:56:59

标签: google-app-engine

我按照谷歌云控制台右侧教程部署ruby项目,在克隆了演示源代码后尝试使用命令gcloud app deploy --project fireflywytwyt进行部署,它向我抛出以下错误(省略了不必要的日志):

...
8820c09c846d: Image already exists
64fc2a97cff9: Image already exists
43f58141118b: Image already exists
575d6bde5efe: Image already exists
272ffca85019: Image already exists
90a62e26e551: Image already exists
a51047f764d0: Image already exists
2c8496abe349: Image already exists
6e04b82f3d6e: Image already exists
latest: digest: sha256:406115ccfa93d7cef120b2683f75c9f5b3821d8a11b8afbca7781240c293313e size: 72372
DONE
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Updating service [default]...failed.                                                                                                                                             
ERROR: (gcloud.app.deploy) Error Response: [7] The user fireflywytwyt@appspot.gserviceaccount.com must have permission to read the image at us.gcr.io/fireflywytwyt/appengine/def
ault.20161124t144728:latest

请注意错误:

The user fireflywytwyt@appspot.gserviceaccount.com must have permission to read the image at us.gcr.io/fireflywytwyt/appengine/def

看来我的帐户无法访问docker注册表,如何修复?

2 个答案:

答案 0 :(得分:6)

您需要为服务用户(在您的情况下为 fireflywytwyt@appspot.gserviceaccount.com )提供编辑角色。要做到这一点

  • 打开IAM&云平台控制台中的管理员页面。

  • 选择您的项目,然后点击继续。

  • 点击添加成员。
  • 输入服务帐户的电子邮件地址,选择编辑角色,然后点击添加。

答案 1 :(得分:0)

为您的服务帐户授予适当的权限:

gcloud项目add-iam-policy-binding $ {PROJECT_ID} \ - member serviceAccount:codelab @ $ {PROJECT_ID} .iam.gserviceaccount.com \ - 角色/所有者