From 0d4487f168dfddd80c857e47ad6fc32851c40d92 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 1 Feb 2024 12:55:36 +0100 Subject: [PATCH] storage: clarify that anonymous volumes arent reused Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- content/storage/_index.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/content/storage/_index.md b/content/storage/_index.md index 2aac35e2a8..443d0a76b6 100644 --- a/content/storage/_index.md +++ b/content/storage/_index.md @@ -77,9 +77,13 @@ When you mount a volume, it may be named or anonymous. Anonymous volumes are given a random name that's guaranteed to be unique within a given Docker host. Just like named volumes, anonymous volumes persist even if you remove the container that uses them, except if you use the `--rm` flag when creating the -container. Docker automatically removes anonymous volume mounts for containers -created with the `--rm` flag. See [Remove anonymous -volumes](volumes.md#remove-anonymous-volumes). +container, in which case the anonymous volume is destroyed. +See [Remove anonymous volumes](volumes.md#remove-anonymous-volumes). +If you create multiple containers after each other that use anonymous volumes, +each container creates its own volume. +Anonymous volumes aren't reused or shared between containers automatically. +To share an anonymous volume between two or more containers, +you must mount the anonymous volume using the random volume ID. Volumes also support the use of volume drivers, which allow you to store your data on remote hosts or cloud providers, among other possibilities.