From e165ded13efb8cd529a0d1fe4b060776d91e1114 Mon Sep 17 00:00:00 2001 From: "Andrew C. Bodine" Date: Mon, 24 Nov 2014 23:41:49 -0800 Subject: [PATCH] Closes #9296 adds a more detailed note about the mount behavior with -v flag Signed-off-by: Andrew C. Bodine Upstream-commit: efb8e8a34550b80a567e7b69ad6bb2644d5a9b09 Component: engine --- .../engine/docs/sources/userguide/dockervolumes.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/engine/docs/sources/userguide/dockervolumes.md b/components/engine/docs/sources/userguide/dockervolumes.md index 58412611c5..6f94b6dbd0 100644 --- a/components/engine/docs/sources/userguide/dockervolumes.md +++ b/components/engine/docs/sources/userguide/dockervolumes.md @@ -51,8 +51,15 @@ directory from your own host into a container. $ sudo docker run -d -P --name web -v /src/webapp:/opt/webapp training/webapp python app.py -This will mount the local directory, `/src/webapp`, into the container as the -`/opt/webapp` directory. This is very useful for testing, for example we can +This will mount the host directory, `/src/webapp`, into the container at +`/opt/webapp`. + +> **Note:** +> If the path `/opt/webapp` already exists inside the container's image, it's +> contents will be replaced by the contents of `/src/webapp` on the host to stay +> consistent with the expected behavior of `mount` + +This is very useful for testing, for example we can mount our source code inside the container and see our application at work as we change the source code. The directory on the host must be specified as an absolute path and if the directory doesn't exist Docker will automatically