【问题标题】:Why is my Container Builder build failing with "failed to find one or more images after execution of build steps"为什么我的 Container Builder 构建失败并显示“执行构建步骤后找不到一个或多个图像”
【发布时间】:2017-12-13 01:56:53
【问题描述】:

我不明白此错误消息的含义。它发生在我的构建结束时,当构建完成并且图像被标记时。这是日志的结尾:

Step 17/18 : WORKDIR /var/www
---> 0cb8de2acd8f
Removing intermediate container 7e7838eac6fb
Step 18/18 : CMD bundle exec puma -C config/puma.rb
---> Running in 9089eb79192b
---> 890a53af5964
Removing intermediate container 9089eb79192b
Successfully built 890a53af5964
Successfully tagged us.gcr.io/foo-staging/foobar:latest
ERROR
ERROR: failed to find one or more images after execution of build steps: ["us.gcr.io/foo-staging/foobar:a2122696c92f430529197dea8213c96b3eee8ee4"]

这是我的cloudbuild.yaml

steps:
- name: 'gcr.io/cloud-builders/docker'
  args: [ 'build', '-t', 'us.gcr.io/$PROJECT_ID/foobar', '.' ]
images:
- 'us.gcr.io/$PROJECT_ID/foobar:$COMMIT_SHA'
- 'us.gcr.io/$PROJECT_ID/foobar:latest'
timeout: 3600s

我认为这可能是暂时的失败,但我重试了构建,但又发生了。

【问题讨论】:

    标签: google-cloud-platform google-container-registry google-container-builder


    【解决方案1】:

    啊,我需要在构建步骤中标记构建:

    steps:
    - name: 'gcr.io/cloud-builders/docker'
      args: [ 'build', '-t', 'us.gcr.io/$PROJECT_ID/foobar:$COMMIT_SHA', '-t', 'us.gcr.io/$PROJECT_ID/foobar:latest', '.' ]
    images:
    - 'us.gcr.io/$PROJECT_ID/foobar:$COMMIT_SHA'
    - 'us.gcr.io/$PROJECT_ID/foobar:latest'
    timeout: 3600s
    

    【讨论】:

    • 就我而言,我从快速入门图片开始,需要用我的应用名称gcloud container images add-tag --quiet gcr.io/thinking-field-195914/quickstart-image:latest gcr.io/[PROJECT_NAME]/[APP_NAME]:latest重新标记它
    • 事实上事情似乎已经改变了,因为我的客户不接受 yaml,返回错误拒绝在 args 中带有: 的标签格式
    猜你喜欢
    • 2016-02-21
    • 1970-01-01
    • 2019-12-01
    • 2016-01-26
    • 2017-06-19
    • 2017-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多