ScanSkill

docker restart

docker restart command is used to restart one or more containers. Or, alternatively docker container restart command is also valid.

Syntax

$ docker restart [OPTIONS] CONTAINER [CONTAINER...]

Options

  • --time , -t → Seconds to wait for stop before killing it (Default is 10)

Example

  • Restart the container
$ docker restart my_container

It will restart the container my_container.

  • With time period
docker restart --time 20 my_container

When running this, the container will restart after 20 seconds.