diff --git a/daemon/stats.go b/daemon/stats.go index f76a689775..7f9bef08cb 100644 --- a/daemon/stats.go +++ b/daemon/stats.go @@ -30,8 +30,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{}) }