compose/docs/reference/compose_rm.md
Guillaume Lours 312f0d1d61 Update dry-run documentation
Co-authored-by: Allie Sadler <102604716+aevesdocker@users.noreply.github.com>
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2023-05-15 09:39:46 +02:00

40 lines
1.3 KiB
Markdown

# 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
| Name | Type | Default | Description |
|:------------------|:-----|:--------|:----------------------------------------------------|
| `--dry-run` | | | Execute command in dry run mode |
| `-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 |
<!---MARKER_GEN_END-->
## 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`:
```console
$ docker compose rm
Going to remove djangoquickstart_web_run_1
Are you sure? [yN] y
Removing djangoquickstart_web_run_1 ... done
```