From 0fd935b0ca6e7abf1d31f2058ee1232979e353d5 Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Tue, 29 Oct 2024 10:34:20 +0100 Subject: [PATCH] Skip Builder Init For Bake List Flags Add the flags --list-targets and --list-variables to the cases where initializing the builder can be skipped. This allows the listing of targets and variables when no builder is available. Resolves: docker/buildx#2755 Signed-off-by: Tim Neumann --- commands/bake.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/bake.go b/commands/bake.go index 95fdcea587b..95316c14643 100644 --- a/commands/bake.go +++ b/commands/bake.go @@ -116,7 +116,7 @@ func runBake(ctx context.Context, dockerCli command.Cli, targets []string, in ba // instance only needed for reading remote bake files or building var driverType string - if url != "" || !in.printOnly { + if url != "" || !(in.printOnly || in.listTargets || in.listVars) { b, err := builder.New(dockerCli, builder.WithName(in.builder), builder.WithContextPathHash(contextPathHash),