Debian Codegraph @

docs/reference/compose_rm.md

raw
1 # docker compose rm
2
3 <!---MARKER_GEN_START-->
4 Removes stopped service containers.
5
6 By default, anonymous volumes attached to containers are not removed. You can override this with `-v`. To list all
7 volumes, use `docker volume ls`.
8
9 Any data which is not in a volume is lost.
10
11 Running the command with no options also removes one-off containers created by `docker compose run`:
12
13 ```console
14 $ docker compose rm
15 Going to remove djangoquickstart_web_run_1
16 Are you sure? [yN] y
17 Removing djangoquickstart_web_run_1 ... done
18 ```
19
20 ### Options
21
22 | Name | Type | Default | Description |
23 |:------------------|:-------|:--------|:----------------------------------------------------|
24 | `--dry-run` | `bool` | | Execute command in dry run mode |
25 | `-f`, `--force` | `bool` | | Don't ask to confirm removal |
26 | `-s`, `--stop` | `bool` | | Stop the containers, if required, before removing |
27 | `-v`, `--volumes` | `bool` | | Remove any anonymous volumes attached to containers |
28
29
30 <!---MARKER_GEN_END-->
31
32 ## Description
33
34 Removes stopped service containers.
35
36 By default, anonymous volumes attached to containers are not removed. You can override this with `-v`. To list all
37 volumes, use `docker volume ls`.
38
39 Any data which is not in a volume is lost.
40
41 Running the command with no options also removes one-off containers created by `docker compose run`:
42
43 ```console
44 $ docker compose rm
45 Going to remove djangoquickstart_web_run_1
46 Are you sure? [yN] y
47 Removing djangoquickstart_web_run_1 ... done
48 ```