diff --git a/daemon/pause.go b/daemon/pause.go index e94c8b868f..a8ce013d4f 100644 --- a/daemon/pause.go +++ b/daemon/pause.go @@ -35,6 +35,11 @@ func (daemon *Daemon) containerPause(container *container.Container) error { return derr.ErrorCodeAlreadyPaused.WithArgs(container.ID) } + // We cannot Pause the container which is restarting + if container.Restarting { + return derr.ErrorCodeContainerRestarting.WithArgs(container.ID) + } + if err := daemon.execDriver.Pause(container.Command); err != nil { return derr.ErrorCodeCantPause.WithArgs(container.ID, err) }