Fix printing docker build output if -v is given (#1255)

The current version only prints the docker build output if the build
was successful.
This commit is contained in:
Christian Fetzer
2020-03-08 13:59:58 +08:00
committed by GitHub
parent 2bdb3261a0
commit 671035e1f8
+4 -2
View File
@@ -71,12 +71,14 @@ func (c *Build) BuildImage(source string, image string, dockerfile string) error
}
// Build it!
if err := c.Client.BuildImage(opts); err != nil {
err = c.Client.BuildImage(opts)
log.Debugf("Image %s build output:\n%s", image, outputBuffer)
if err != nil {
return errors.Wrap(err, "Unable to build image. For more output, use -v or --verbose when converting.")
}
log.Infof("Image '%s' from directory '%s' built successfully", image, path.Base(source))
log.Debugf("Image %s build output:\n%s", image, outputBuffer)
return nil
}