1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #9491 from SvenDowideit/note-that-volumes-in-b2d-are-special

Add a note to point out to new users that B2D bind-mounts are special-ish
This commit is contained in:
Fred Lifton 2014-12-31 11:15:01 -08:00
commit 880aeab00d

View file

@ -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
@ -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