diff --git a/components/engine/daemon/stats.go b/components/engine/daemon/stats.go index 2db6852560..016dd9b8b7 100644 --- a/components/engine/daemon/stats.go +++ b/components/engine/daemon/stats.go @@ -27,8 +27,8 @@ func (daemon *Daemon) ContainerStats(ctx context.Context, prefixOrName string, c return err } - // If the container is not running and requires no stream, return an empty stats. - if !container.IsRunning() && !config.Stream { + // If the container is either not running or restarting and requires no stream, return an empty stats. + if (!container.IsRunning() || container.IsRestarting()) && !config.Stream { return json.NewEncoder(config.OutStream).Encode(&types.Stats{}) }