From 5bac0b1197eff580e2faa7e5e43bf573e4d7a64e Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Thu, 10 Apr 2025 19:59:55 +0200 Subject: [PATCH] build: print frontend inline message Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- commands/bake.go | 8 ++++++++ commands/build.go | 4 ++++ 2 files changed, 12 insertions(+) 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 }