bake: do not fail printing definition if instance unavailable

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
pull/1345/head
CrazyMax 2 years ago
parent 105c214d15
commit c53b0b8a12
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7

@ -86,13 +86,17 @@ func runBake(dockerCli command.Cli, targets []string, in bakeOptions) (err error
}
}()
dis, err := getInstanceOrDefault(ctx, dockerCli, in.builder, contextPathHash)
var dis []build.DriverInfo
var files []bake.File
var inp *bake.Input
// instance only needed for reading remote bake files or building
if url != "" || !in.printOnly {
dis, err = getInstanceOrDefault(ctx, dockerCli, in.builder, contextPathHash)
if err != nil {
return err
}
var files []bake.File
var inp *bake.Input
}
if url != "" {
files, inp, err = bake.ReadRemoteFiles(ctx, dis, url, in.files, printer)

Loading…
Cancel
Save