From c3e5e4995745d803cace6cd72d6f97c88b756b47 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Thu, 24 Nov 2022 15:42:28 +0100 Subject: [PATCH] configure buildx for plain output if --ansi=never has been set Signed-off-by: Nicolas De Loof --- cmd/compose/build.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/compose/build.go b/cmd/compose/build.go index a3b35ff85..ddd0b3b3e 100644 --- a/cmd/compose/build.go +++ b/cmd/compose/build.go @@ -26,6 +26,7 @@ import ( "github.com/compose-spec/compose-go/loader" "github.com/compose-spec/compose-go/types" buildx "github.com/docker/buildx/util/progress" + "github.com/docker/compose/v2/pkg/progress" "github.com/docker/compose/v2/pkg/utils" "github.com/spf13/cobra" @@ -100,6 +101,9 @@ func buildCommand(p *projectOptions, backend api.Service) *cobra.Command { if cmd.Flags().Changed("ssh") && opts.ssh == "" { opts.ssh = "default" } + if progress.Mode == progress.ModePlain && !cmd.Flags().Changed("progress") { + opts.progress = buildx.PrinterModePlain + } return runBuild(ctx, backend, opts, args) }), ValidArgsFunction: completeServiceNames(p),