Cloud Build 无法创建映像并将其发布到 Container Registry

Cloud Build could not create an image and publish it to Container Registry

我的objective是为Django Rest Framework项目创建一个CI/CD。我使用 Google Source Repository 进行版本控制,使用 Google Compute Engine VM 实例进行部署。该项目的 Dockerfile 能够创建图像,我也能够 运行 该图像。

现在,在 Source Repository 上,当我将其他分支与 master 分支合并时,云触发器应该能够创建一个新图像,将其推送到 Container Repository 并更新 [= 的现有实例13=] 使用新容器。

到目前为止,每次推送到 master 分支时 Cloud Build - Trigger 都能够创建映像并将其推送到 Container Registry。但是 Cloud Build - Trigger 使用 Dockerfile 而不是 cloudbuild.yaml.

这是我装箱的cloudbuild.ymal

steps:
    - name: 'gcr.io/myproject-100/docker'
      args: [ 'build', '-t', 'gcr.io/myproject-100/dropoff:', '.' ]

    - name: 'gcr.io/cloud-builders/gcloud'
      args: [ 'compute', 'instance', 'update-container', 'dropoff-staging-v3', --zone='northeast1-a' ]
    
    images:
    - 'gcr.io/myproject-100/dropoff'

Dockerfilecloudbuild.yaml在项目文件夹的根目录下。当我 运行 命令 gcloud builds submit --config cloudbuild.yaml 我得到这个错误 -

ERROR: (gcloud.builds.submit) parsing cloudbuild.yaml: while parsing a block collection
  in "cloudbuild.yaml", line 2, column 5
expected <block end>, but found u'?'
  in "cloudbuild.yaml", line 4, column 5
  1. 是什么导致了这个错误,我该如何解决这个问题。
  2. 你认为我写 cloudbuild.yaml 的方式会帮助我实现我的 objective。

cloudbuild.yaml 似乎完全不相关,

因为第2行和第4行第5列没有“u”;全线一个都没有

请参阅 YAML in a Nutshell 了解如何正确缩进;它应该看起来更像这样:

steps:
  - name: 'gcr.io/dropoff-280002/docker'
    args: [ 'build', '-t', 'gcr.io/dropoff-280002/dropoff:', '.' ]
  - name: 'gcr.io/cloud-builders/gcloud'
    args: [ 'compute', 'instance', 'update-container', 'dropoff-staging-v3', --zone='northeast1-a' ]    
images:
  - 'gcr.io/dropoff-280002/dropoff'

或查看此 cloudbuild.yaml ...已知有效。