📅  最后修改于: 2023-12-03 14:40:51.386000             🧑  作者: Mango
In Docker, the docker restart
command is used to restart one or more containers that are already running. It provides a way to gracefully restart containers, ensuring the application within the container remains available during the restart process.
The basic syntax of the docker restart
command is:
$ docker restart [OPTIONS] CONTAINER [CONTAINER...]
Some commonly used options with the docker restart
command are:
--time
or -t
: Optional time to wait for the container to stop before restarting it. The default is 10 seconds.--help
: Show help information about the command.Restart a single container:
$ docker restart my-container
Restart multiple containers:
$ docker restart container1 container2
Restart a container with a delay:
$ docker restart --time 30 my-container
The docker restart
command allows you to gracefully restart one or more containers in Docker. It provides flexibility by allowing you to specify a delay before restarting, and it ensures the application remains accessible during the restart process. Make sure to explore additional options and parameters available with the command to suit your specific requirements.
For more information and detailed usage, refer to the Docker documentation.