2022-03-09 12:57:07 +01:00
|
|
|
|
# docker compose down
|
2021-03-11 16:20:30 +01:00
|
|
|
|
|
2022-03-09 12:57:07 +01:00
|
|
|
|
<!---MARKER_GEN_START-->
|
|
|
|
|
Stop and remove containers, networks
|
|
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
2022-12-29 14:32:16 +01:00
|
|
|
|
| Name | Type | Default | Description |
|
|
|
|
|
|:-------------------|:---------|:--------|:-------------------------------------------------------------------------------------------------------------------------|
|
2023-05-05 12:43:27 +02:00
|
|
|
|
| `--dry-run` | | | Execute command in dry run mode |
|
2022-12-29 14:32:16 +01:00
|
|
|
|
| `--remove-orphans` | | | Remove containers for services not defined in the Compose file. |
|
|
|
|
|
| `--rmi` | `string` | | Remove images used by services. "local" remove only images that don't have a custom tag ("local"\|"all") |
|
2023-06-12 15:18:25 +02:00
|
|
|
|
| `-t`, `--timeout` | `int` | `0` | Specify a shutdown timeout in seconds |
|
2023-05-24 19:40:27 +02:00
|
|
|
|
| `-v`, `--volumes` | | | Remove named volumes declared in the "volumes" section of the Compose file and anonymous volumes attached to containers. |
|
2022-03-09 12:57:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!---MARKER_GEN_END-->
|
2021-03-11 16:20:30 +01:00
|
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
|
2021-09-13 22:58:29 +02:00
|
|
|
|
Stops containers and removes containers, networks, volumes, and images created by `up`.
|
2021-03-11 16:20:30 +01:00
|
|
|
|
|
|
|
|
|
By default, the only things removed are:
|
|
|
|
|
|
|
|
|
|
- Containers for services defined in the Compose file
|
|
|
|
|
- Networks defined in the networks section of the Compose file
|
|
|
|
|
- The default network, if one is used
|
|
|
|
|
|
|
|
|
|
Networks and volumes defined as external are never removed.
|
|
|
|
|
|
|
|
|
|
Anonymous volumes are not removed by default. However, as they don’t have a stable name, they will not be automatically
|
|
|
|
|
mounted by a subsequent `up`. For data that needs to persist between updates, use explicit paths as bind mounts or
|
|
|
|
|
named volumes.
|