Skip to content

Commit 7326b93

Browse files
committed
Explain the auto-removal of anonymous volumes
at the description of 'create --rm' and 'run --rm' Signed-off-by: Park Jaeon <me@finalchild.dev>
1 parent fff5a31 commit 7326b93

8 files changed

Lines changed: 8 additions & 8 deletions

File tree

cli/command/container/opts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func addFlags(flags *pflag.FlagSet) *containerOptions {
190190
flags.Var(copts.ulimits, "ulimit", "Ulimit options")
191191
flags.StringVarP(&copts.user, "user", "u", "", "Username or UID (format: <name|uid>[:<group|gid>])")
192192
flags.StringVarP(&copts.workingDir, "workdir", "w", "", "Working directory inside the container")
193-
flags.BoolVar(&copts.autoRemove, "rm", false, "Automatically remove the container when it exits")
193+
flags.BoolVar(&copts.autoRemove, "rm", false, "Automatically remove the container and its associated anonymous volumes when it exits")
194194

195195
// Security
196196
flags.Var(&copts.capAdd, "cap-add", "Add Linux capabilities")

contrib/completion/fish/docker.fish

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s p -l publish
253253
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s P -l publish-all -d 'Publish all exposed ports to random ports'
254254
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l read-only -d "Mount the container's root filesystem as read only"
255255
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l restart -d 'Restart policy to apply when a container exits'
256-
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l rm -d 'Automatically remove the container when it exits'
256+
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l rm -d 'Automatically remove the container and its associated anonymous volumes when it exits'
257257
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l runtime -d 'Runtime to use for this container'
258258
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l security-opt -d 'Security Options'
259259
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l shm-size -d 'Size of /dev/shm'

docs/reference/commandline/container_create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Create a new container
9191
| `-q`, `--quiet` | | | Suppress the pull output |
9292
| `--read-only` | | | Mount the container's root filesystem as read only |
9393
| `--restart` | `string` | `no` | Restart policy to apply when a container exits |
94-
| `--rm` | | | Automatically remove the container when it exits |
94+
| `--rm` | | | Automatically remove the container and its associated anonymous volumes when it exits |
9595
| `--runtime` | `string` | | Runtime to use for this container |
9696
| `--security-opt` | `list` | | Security Options |
9797
| `--shm-size` | `bytes` | `0` | Size of /dev/shm |

docs/reference/commandline/container_run.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Create and run a new container from an image
9393
| `-q`, `--quiet` | | | Suppress the pull output |
9494
| `--read-only` | | | Mount the container's root filesystem as read only |
9595
| `--restart` | `string` | `no` | Restart policy to apply when a container exits |
96-
| `--rm` | | | Automatically remove the container when it exits |
96+
| `--rm` | | | Automatically remove the container and its associated anonymous volumes when it exits |
9797
| `--runtime` | `string` | | Runtime to use for this container |
9898
| `--security-opt` | `list` | | Security Options |
9999
| `--shm-size` | `bytes` | `0` | Size of /dev/shm |

docs/reference/commandline/create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Create a new container
9191
| `-q`, `--quiet` | | | Suppress the pull output |
9292
| `--read-only` | | | Mount the container's root filesystem as read only |
9393
| `--restart` | `string` | `no` | Restart policy to apply when a container exits |
94-
| `--rm` | | | Automatically remove the container when it exits |
94+
| `--rm` | | | Automatically remove the container and its associated anonymous volumes when it exits |
9595
| `--runtime` | `string` | | Runtime to use for this container |
9696
| `--security-opt` | `list` | | Security Options |
9797
| `--shm-size` | `bytes` | `0` | Size of /dev/shm |

docs/reference/commandline/run.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Create and run a new container from an image
9393
| `-q`, `--quiet` | | | Suppress the pull output |
9494
| `--read-only` | | | Mount the container's root filesystem as read only |
9595
| [`--restart`](#restart) | `string` | `no` | Restart policy to apply when a container exits |
96-
| `--rm` | | | Automatically remove the container when it exits |
96+
| `--rm` | | | Automatically remove the container and its associated anonymous volumes when it exits |
9797
| `--runtime` | `string` | | Runtime to use for this container |
9898
| [`--security-opt`](#security-opt) | `list` | | Security Options |
9999
| `--shm-size` | `bytes` | `0` | Size of /dev/shm |

docs/reference/run.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ systems can really pile up. If instead you'd like Docker to
660660
**automatically clean up the container and remove the file system when
661661
the container exits**, you can add the `--rm` flag:
662662

663-
--rm=false: Automatically remove the container when it exits
663+
--rm=false: Automatically remove the container and its associated anonymous volumes when it exits
664664

665665
> **Note**
666666
>

man/docker-run.1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ its root filesystem mounted as read only prohibiting any writes.
590590
Default is **no**.
591591

592592
**--rm** **true**|**false**
593-
Automatically remove the container when it exits. The default is **false**.
593+
Automatically remove the container and its associated anonymous volumes when it exits. The default is **false**.
594594
`--rm` flag can work together with `-d`, and auto-removal will be done on daemon side. Note that it's
595595
incompatible with any restart policy other than `none`.
596596

0 commit comments

Comments
 (0)