docker restart
command is used to restart one or more containers. Or, alternatively docker container restart
command is also valid.
$ docker restart [OPTIONS] CONTAINER [CONTAINER...]
--time
, -t
→ Seconds to wait for stop before killing it (Default is 10)$ docker restart my_container
It will restart the container my_container
.
docker restart --time 20 my_container
When running this, the container will restart after 20 seconds.