Skip to content

Commit a673da3

Browse files
authored
Merge pull request #24440 from docker/fix-gh-19717-rm-detached
Clarify --rm behavior with detached containers
2 parents 55e175d + 94c2be0 commit a673da3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

content/manuals/engine/storage/volumes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,9 @@ To automatically remove anonymous volumes, use the `--rm` option. For example,
784784
this command creates an anonymous `/foo` volume. When you remove the container,
785785
the Docker Engine removes the `/foo` volume but not the `awesome` volume.
786786

787+
The `--rm` option works with both foreground and detached (`-d`) containers.
788+
The anonymous volumes are cleaned up when the container exits.
789+
787790
```console
788791
$ docker run --rm -v /foo -v awesome:/bar busybox top
789792
```

0 commit comments

Comments
 (0)