📜  docker compose down - Shell-Bash (1)

📅  最后修改于: 2023-12-03 15:00:28.421000             🧑  作者: Mango

Docker Compose Down

Docker Compose Down is a command used to shut down the containers defined in a Docker Compose project. It frees up resources and ensures that the containers are stopped correctly.

Usage

The syntax for the command is as follows:

docker-compose down [options]
Options

The following options can be used with the docker-compose down command:

  • -v, --volumes: Remove named volumes declared in the 'volumes' section of the Compose file and anonymous volumes attached to containers.
  • --rmi type: Remove images. Type must be one of 'all', 'local', or 'none'. By default, only images that are not referenced by any containers are removed.
  • -t, --timeout TIMEOUT: Specify a shutdown timeout in seconds. The default is 10 seconds.
Example

Here's an example of using the docker-compose down command:

docker-compose down

This command will stop and shut down all containers defined in the Compose file.

Conclusion

The docker-compose down command is an efficient way to shut down containers defined in a Docker Compose project. It helps to free up resources and ensure that the containers are stopped correctly. Remember to use the appropriate options with the command for more control over the process.