| 1 |
# docker compose down |
| 2 |
|
| 3 |
<!---MARKER_GEN_START--> |
| 4 |
Stops containers and removes containers, networks, volumes, and images created by `up`. |
| 5 |
|
| 6 |
By default, the only things removed are: |
| 7 |
|
| 8 |
- Containers for services defined in the Compose file. |
| 9 |
- Networks defined in the networks section of the Compose file. |
| 10 |
- The default network, if one is used. |
| 11 |
|
| 12 |
Networks and volumes defined as external are never removed. |
| 13 |
|
| 14 |
Anonymous volumes are not removed by default. However, as they don’t have a stable name, they are not automatically |
| 15 |
mounted by a subsequent `up`. For data that needs to persist between updates, use explicit paths as bind mounts or |
| 16 |
named volumes. |
| 17 |
|
| 18 |
### Options |
| 19 |
|
| 20 |
| Name | Type | Default | Description | |
| 21 |
|:-------------------|:---------|:--------|:------------------------------------------------------------------------------------------------------------------------| |
| 22 |
| `--dry-run` | `bool` | | Execute command in dry run mode | |
| 23 |
| `--remove-orphans` | `bool` | | Remove containers for services not defined in the Compose file | |
| 24 |
| `--rmi` | `string` | | Remove images used by services. "local" remove only images that don't have a custom tag ("local"\|"all") | |
| 25 |
| `-t`, `--timeout` | `int` | `0` | Specify a shutdown timeout in seconds | |
| 26 |
| `-v`, `--volumes` | `bool` | | Remove named volumes declared in the "volumes" section of the Compose file and anonymous volumes attached to containers | |
| 27 |
|
| 28 |
|
| 29 |
<!---MARKER_GEN_END--> |
| 30 |
|
| 31 |
## Description |
| 32 |
|
| 33 |
Stops containers and removes containers, networks, volumes, and images created by `up`. |
| 34 |
|
| 35 |
By default, the only things removed are: |
| 36 |
|
| 37 |
- Containers for services defined in the Compose file. |
| 38 |
- Networks defined in the networks section of the Compose file. |
| 39 |
- The default network, if one is used. |
| 40 |
|
| 41 |
Networks and volumes defined as external are never removed. |
| 42 |
|
| 43 |
Anonymous volumes are not removed by default. However, as they don’t have a stable name, they are not automatically |
| 44 |
mounted by a subsequent `up`. For data that needs to persist between updates, use explicit paths as bind mounts or |
| 45 |
named volumes. |