6

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.

Abe Voelker
  • 30,124
  • 14
  • 81
  • 98

1 Answers1

16

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
Abe Voelker
  • 30,124
  • 14
  • 81
  • 98
  • in my case I'd started with the quickstart image and needed to re tag it with my app name ```gcloud container images add-tag --quiet gcr.io/thinking-field-195914/quickstart-image:latest gcr.io/[PROJECT_NAME]/[APP_NAME]:latest``` – barrymac Apr 26 '18 at 17:43
  • in fact things seem to have changed because that yaml is not accepted by my client, returning an error reject the tag format with `:` in the args – barrymac Apr 26 '18 at 18:00