Browse Source

Merge pull request #15718 from ZJU-SEL/rm-volume-action

specify `docker run --rm` action when it comes to volume
Sebastiaan van Stijn 10 năm trước cách đây
mục cha
commit
5ceff3f191
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      docs/reference/run.md

+ 4 - 0
docs/reference/run.md

@@ -463,6 +463,10 @@ the container exits**, you can add the `--rm` flag:
 
     --rm=false: Automatically remove the container when it exits (incompatible with -d)
 
+> **Note**: When you set the `--rm` flag, Docker also removes the volumes 
+associated with the container when the container is removed. This is similar 
+to running `docker rm -v my-container`.
+
 ## Security configuration
     --security-opt="label:user:USER"   : Set the label user for the container
     --security-opt="label:role:ROLE"   : Set the label role for the container