📜  dokcer restart (1)

📅  最后修改于: 2023-12-03 14:40:51.386000             🧑  作者: Mango

Docker Restart

Introduction

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.

Syntax

The basic syntax of the docker restart command is:

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

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.
Examples
  1. Restart a single container:

    $ docker restart my-container
    
  2. Restart multiple containers:

    $ docker restart container1 container2
    
  3. Restart a container with a delay:

    $ docker restart --time 30 my-container
    
Conclusion

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.