Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my Container Builder build failing with "failed to find one or more images after execution of build steps"

I don't understand what this error message means. It happens at the end of my build, when the build is complete and the image is being tagged. Here's the tail end of the log:

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"]

Here's my 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

I thought maybe it was a transient failure, but I retried the build and it happened again.

like image 581
Abe Voelker Avatar asked Dec 13 '17 01:12

Abe Voelker


1 Answers

Ah I needed to tag the build in the build step:

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
like image 60
Abe Voelker Avatar answered Oct 22 '22 15:10

Abe Voelker