simpledocker: Support show_build_output option

This commit is contained in:
Daniele Rondina 2019-12-29 16:20:16 +01:00 committed by Ettore Di Giacinto
parent da11a84d23
commit 358b39b5dd
No known key found for this signature in database
GPG Key ID: 1ADA699B145A2D1C

View File

@ -26,6 +26,7 @@ import (
capi "github.com/mudler/docker-companion/api"
"github.com/mudler/luet/pkg/compiler"
"github.com/mudler/luet/pkg/config"
"github.com/mudler/luet/pkg/helpers"
. "github.com/mudler/luet/pkg/logger"
@ -54,7 +55,12 @@ func (*SimpleDocker) BuildImage(opts compiler.CompilerBackendOptions) error {
}
Info(":whale: Building image " + name + " done")
//Info(string(out))
if config.LuetCfg.GetGeneral().ShowBuildOutput {
Info(string(out))
} else {
Debug(string(out))
}
return nil
}
@ -229,6 +235,12 @@ func (*SimpleDocker) Changes(fromImage, toImage string) ([]compiler.ArtifactLaye
return []compiler.ArtifactLayer{}, errors.Wrap(err, "Failed Resolving layer diffs: "+string(out))
}
if config.LuetCfg.GetGeneral().ShowBuildOutput {
Info(string(out))
} else {
Debug(string(out))
}
var diffs []compiler.ArtifactLayer
err = json.Unmarshal(out, &diffs)