Don't specify image if build failed.
@@ -45,7 +45,11 @@ func (b *Builder) buildDocker(ctx context.Context, out io.Writer, workspace stri
imageID, err = b.localDocker.Build(ctx, out, workspace, a, tag)
}
- if err == nil && b.pushImages {
+ if err != nil {
+ return "", err
+ }
+
+ if b.pushImages {
return b.localDocker.Push(ctx, out, tag)
}
