Skip to content

Commit

Permalink
Merge pull request moby#9491 from SvenDowideit/note-that-volumes-in-b…
Browse files Browse the repository at this point in the history
…2d-are-special

Add a note to point out to new users that B2D bind-mounts are special-ish
  • Loading branch information
Fred Lifton committed Dec 31, 2014
2 parents 31471ea + e529885 commit 880aeab
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docs/sources/userguide/dockervolumes.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@ This will create a new volume inside a container at `/webapp`.
### Mount a Host Directory as a Data Volume

In addition to creating a volume using the `-v` flag you can also mount a
directory from your own host into a container.
directory from your Docker daemon's host into a container.

> **Note:**
> If you are using Boot2Docker, your Docker daemon only has limited access to
> your OSX/Windows filesystem. Boot2Docker tries to auto-share your `/Users`
> (OSX) or `C:\Users` (Windows) directory - and so you can mount files or directories
> using `docker run -v /Users/<path>:/<container path> ...` (OSX) or
> `docker run -v /c/Users/<path>:/<container path ...` (Windows). All other paths
> come from the Boot2Docker virtual machine's filesystem.
$ sudo docker run -d -P --name web -v /src/webapp:/opt/webapp training/webapp python app.py

Expand All @@ -68,8 +76,8 @@ create it for you.

> **Note:**
> This is not available from a `Dockerfile` due to the portability
> and sharing purpose of it. As the host directory is, by its nature,
> host-dependent, a host directory specified in a `Dockerfile` probably
> and sharing purpose of built images. The host directory is, by its nature,
> host-dependent, so a host directory specified in a `Dockerfile` probably
> wouldn't work on all hosts.
Docker defaults to a read-write volume but we can also mount a directory
Expand Down

0 comments on commit 880aeab

Please sign in to comment.