Merge pull request #2534 from tonistiigi/bake-warnings

bake: print warnings on progress
This commit is contained in:
CrazyMax 2024-07-01 18:16:52 +02:00 committed by GitHub
commit 17878d641e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -124,8 +124,12 @@ func runBake(ctx context.Context, dockerCli command.Cli, targets []string, in ba
}
progressMode := progressui.DisplayMode(cFlags.progress)
printer, err := progress.NewPrinter(ctx2, os.Stderr, progressMode,
var printer *progress.Printer
printer, err = progress.NewPrinter(ctx2, os.Stderr, progressMode,
progress.WithDesc(progressTextDesc, progressConsoleDesc),
progress.WithOnClose(func() {
printWarnings(os.Stderr, printer.Warnings(), progressMode)
}),
)
if err != nil {
return err