Merge pull request #992 from tonistiigi/bake-metadata-fix

bake: restore consistent output for metadata
pull/993/head
CrazyMax 3 years ago committed by GitHub
commit a7fba7bf3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -150,21 +150,13 @@ func runBake(dockerCli command.Cli, targets []string, in bakeOptions) (err error
return wrapBuildError(err, true) return wrapBuildError(err, true)
} }
if len(in.metadataFile) > 0 && resp != nil { if len(in.metadataFile) > 0 {
if len(resp) == 1 { dt := make(map[string]interface{})
for _, r := range resp { for t, r := range resp {
if err := writeMetadataFile(in.metadataFile, decodeExporterResponse(r.ExporterResponse)); err != nil { dt[t] = decodeExporterResponse(r.ExporterResponse)
return err }
} if err := writeMetadataFile(in.metadataFile, dt); err != nil {
} return err
} else {
dt := make(map[string]interface{})
for t, r := range resp {
dt[t] = decodeExporterResponse(r.ExporterResponse)
}
if err := writeMetadataFile(in.metadataFile, dt); err != nil {
return err
}
} }
} }

Loading…
Cancel
Save