diff --git a/commands/bake.go b/commands/bake.go index dea0faba..b2cfe60c 100644 --- a/commands/bake.go +++ b/commands/bake.go @@ -424,6 +424,14 @@ func runBake(ctx context.Context, dockerCli command.Cli, targets []string, in ba fmt.Fprintln(dockerCli.Out(), string(dt)) } + for _, name := range names { + if sp, ok := resp[name]; ok { + if v, ok := sp.ExporterResponse["frontend.result.inlinemessage"]; ok { + fmt.Fprintf(dockerCli.Out(), "\n# %s\n%s\n", name, v) + } + } + } + if exitCode != 0 { os.Exit(exitCode) } diff --git a/commands/build.go b/commands/build.go index 9c3ae280..21b8cd20 100644 --- a/commands/build.go +++ b/commands/build.go @@ -404,6 +404,10 @@ func runBuild(ctx context.Context, dockerCli command.Cli, options buildOptions) os.Exit(exitcode) } } + if v, ok := resp.ExporterResponse["frontend.result.inlinemessage"]; ok { + fmt.Fprintf(dockerCli.Out(), "\n%s\n", v) + return nil + } return nil }