diff --git a/daemon/stats.go b/daemon/stats.go index 56e38061df..8500fb690c 100644 --- a/daemon/stats.go +++ b/daemon/stats.go @@ -31,8 +31,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{}) }