mirror of https://github.com/docker/buildx.git
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 <git@neumann-tim.de>
This commit is contained in:
parent
2bdf451b68
commit
0fd935b0ca
|
@ -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
|
// instance only needed for reading remote bake files or building
|
||||||
var driverType string
|
var driverType string
|
||||||
if url != "" || !in.printOnly {
|
if url != "" || !(in.printOnly || in.listTargets || in.listVars) {
|
||||||
b, err := builder.New(dockerCli,
|
b, err := builder.New(dockerCli,
|
||||||
builder.WithName(in.builder),
|
builder.WithName(in.builder),
|
||||||
builder.WithContextPathHash(contextPathHash),
|
builder.WithContextPathHash(contextPathHash),
|
||||||
|
|
Loading…
Reference in New Issue