diff --git a/pkg/buildx/commands/bake.go b/pkg/buildx/commands/bake.go index 24326a2b..356767c2 100644 --- a/pkg/buildx/commands/bake.go +++ b/pkg/buildx/commands/bake.go @@ -425,7 +425,9 @@ func BakeCmd() *cobra.Command { err = eg.Wait() // Now wait for the printer to finish and flush all output - _ = printer.Wait() + for range projectIDs { + _ = printer.Wait() + } // Print save help and linter output after all project builds complete for _, result := range buildResults { diff --git a/pkg/progresshelper/shared.go b/pkg/progresshelper/shared.go index e9415f18..fc7bcaca 100644 --- a/pkg/progresshelper/shared.go +++ b/pkg/progresshelper/shared.go @@ -50,10 +50,6 @@ func (w *SharedPrinter) Add() { func (w *SharedPrinter) Wait() error { w.wg.Done() - w.wg.Wait() - - w.cancel() - lastPrinter := w.numPrinters.Add(-1) == 0 // The docker progress writer will only return an @@ -62,6 +58,8 @@ func (w *SharedPrinter) Wait() error { // Only the last printer will be the one to stop the docker printer as // the docker printer closes channels. if lastPrinter { + w.wg.Wait() + w.cancel() _ = w.printer.Wait() }