2022-03-09 12:57:07 +01:00
|
|
|
# docker compose rm
|
|
|
|
|
|
|
|
<!---MARKER_GEN_START-->
|
|
|
|
Removes stopped service containers
|
|
|
|
|
|
|
|
By default, anonymous volumes attached to containers will not be removed. You
|
|
|
|
can override this with -v. To list all volumes, use "docker volume ls".
|
|
|
|
|
|
|
|
Any data which is not in a volume will be lost.
|
|
|
|
|
|
|
|
### 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
|
|
|
| `-f`, `--force` | | | Don't ask to confirm removal |
|
|
|
|
| `-s`, `--stop` | | | Stop the containers, if required, before removing |
|
|
|
|
| `-v`, `--volumes` | | | Remove any 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
|
|
|
|
|
|
|
|
Removes stopped service containers.
|
|
|
|
|
|
|
|
By default, anonymous volumes attached to containers are not removed. You can override this with `-v`. To list all
|
|
|
|
volumes, use `docker volume ls`.
|
|
|
|
|
|
|
|
Any data which is not in a volume is lost.
|
|
|
|
|
|
|
|
Running the command with no options also removes one-off containers created by `docker compose run`:
|
|
|
|
|
2021-09-13 17:14:32 +02:00
|
|
|
```console
|
2021-03-11 16:20:30 +01:00
|
|
|
$ docker compose rm
|
|
|
|
Going to remove djangoquickstart_web_run_1
|
|
|
|
Are you sure? [yN] y
|
|
|
|
Removing djangoquickstart_web_run_1 ... done
|
2021-09-13 17:14:32 +02:00
|
|
|
```
|