diff --git a/docker.go b/docker.go index 3ee1a658fc..6bd80c39c4 100644 --- a/docker.go +++ b/docker.go @@ -819,7 +819,16 @@ func (c *DockerContainer) stopLogProduction() error { c.logProductionWaitGroup.Wait() - return <-c.logProductionError + if err := <-c.logProductionError; err != nil { + if errors.Is(err, context.DeadlineExceeded) || errors.Is(err, context.Canceled) { + // Returning context errors is not useful for the consumer. + return nil + } + + return err + } + + return nil } // GetLogProductionErrorChannel exposes the only way for the consumer