From d05504c50f1c8d748a03481f0ec82d525e2ac0be Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Mon, 11 Jan 2021 01:41:44 +0100 Subject: [PATCH] Allow to set default progress through env var Signed-off-by: CrazyMax --- commands/build.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/commands/build.go b/commands/build.go index 262d57b4..8fc68267 100644 --- a/commands/build.go +++ b/commands/build.go @@ -311,7 +311,13 @@ func buildCmd(dockerCli command.Cli, rootOpts *rootOptions) *cobra.Command { func commonBuildFlags(options *commonOptions, flags *pflag.FlagSet) { options.noCache = flags.Bool("no-cache", false, "Do not use cache when building the image") - flags.StringVar(&options.progress, "progress", "auto", "Set type of progress output (auto, plain, tty). Use plain to show container output") + + defaultProgress, ok := os.LookupEnv("BUILDX_PROGRESS_DEFAULT") + if !ok { + defaultProgress = "auto" + } + flags.StringVar(&options.progress, "progress", defaultProgress, "Set type of progress output (auto, plain, tty). Use plain to show container output") + options.pull = flags.Bool("pull", false, "Always attempt to pull a newer version of the image") }