Merge pull request #1345 from crazy-max/bake-print

bake: do not fail printing definition if instance unavailable
This commit is contained in:
CrazyMax 2022-10-18 10:05:14 +02:00 committed by GitHub
commit 58d3a643b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 5 deletions

View File

@ -86,14 +86,18 @@ func runBake(dockerCli command.Cli, targets []string, in bakeOptions) (err error
}
}()
dis, err := getInstanceOrDefault(ctx, dockerCli, in.builder, contextPathHash)
if err != nil {
return err
}
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
}
}
if url != "" {
files, inp, err = bake.ReadRemoteFiles(ctx, dis, url, in.files, printer)
} else {