diff --git a/cli/command/container/stats_helpers.go b/cli/command/container/stats_helpers.go index 8eb7da0fd7a43867bb5df59d22a04cfc8889303e..5fad7404358d1ffa161f267434c7c86ce44ec4c8 100644 --- a/cli/command/container/stats_helpers.go +++ b/cli/command/container/stats_helpers.go @@ -152,11 +152,13 @@ func collect(ctx context.Context, s *formatter.ContainerStats, cli client.APICli waitFirst.Done() } case err := <-u: + s.SetError(err) + if err == io.EOF { + break + } if err != nil { - s.SetError(err) continue } - s.SetError(nil) // if this is the first stat you get, release WaitGroup if !getFirst { getFirst = true