From 6f8852d99d3a2ebaa8f0c3329ef4e40a4b4dfa0c Mon Sep 17 00:00:00 2001 From: Keldon Lee <83437773+Hebe-330@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:50:26 +0800 Subject: [PATCH] Add resource to docker volumes (#6410) * Update 101-volume-mounts.md Add a link to help beginners understanding the subtle differences between `-v` and `--mount` flag. * Update src/data/roadmaps/docker/content/104-data-persistence/101-volume-mounts.md --------- Co-authored-by: Kamran Ahmed --- .../docker/content/104-data-persistence/101-volume-mounts.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/data/roadmaps/docker/content/104-data-persistence/101-volume-mounts.md b/src/data/roadmaps/docker/content/104-data-persistence/101-volume-mounts.md index 96869dea8..04398835f 100644 --- a/src/data/roadmaps/docker/content/104-data-persistence/101-volume-mounts.md +++ b/src/data/roadmaps/docker/content/104-data-persistence/101-volume-mounts.md @@ -34,6 +34,9 @@ docker run -d --mount source=my-volume,destination=/data your-image In both examples above, `my-volume` is the name of the volume we created earlier, and `/data` is the path inside the container where the volume will be mounted. +> For an in-depth exploration of the `-v` and `--mount` flags, consult Docker's official guide on [Choose the -v or --mount flag](https://docs.docker.com/storage/bind-mounts/#choose-the--v-or---mount-flag). + + ## Sharing Volumes Between Containers To share a volume between multiple containers, simply mount the same volume on multiple containers. Here's how to share `my-volume` between two containers running different images: @@ -55,4 +58,4 @@ docker volume rm my-volume That's it! Now you have a basic understanding of volume mounts in Docker. You can use them to persist and share data between your containers efficiently and securely. -- [@article@Docker Volumes](https://docs.docker.com/storage/volumes/). \ No newline at end of file +- [@article@Docker Volumes](https://docs.docker.com/storage/volumes/).