Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • I tried like this kishore$ docker -v /Users/kishore/main_folder:/test_container Docker version 0.9.1, build 867b2a9 kishore$ docker run -v /Users/kishore/main_folder:/test_container Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...] Run a command in a new container -P, --publish-all=false: Publish all exposed ports to the host interfaces -a, --attach=[]: Attach to stdin, stdout or stderr. -c, --cpu-shares=0: CPU shares (relative weight) Commented May 4, 2014 at 16:40
  • 3
    can you have both ADD . and -v volume mount at same time. using default app_dir if not specify a host mount? Commented May 5, 2014 at 5:02
  • @alexzg I don't think we can have only the first one be taken precedence. Also, I am not clear about your 2nd point default app_dir... host mount.. ? Commented May 5, 2014 at 6:29
  • 52
    This worked for me on mac os x with docker-machine and VirtualBox. One caveat I discovered by trial and error is that the host directory must be a full path and not a relative path. Commented Feb 9, 2017 at 22:23
  • 83
    ADD is actually not "mounting" it copies the file into the container persisting it inside. Commented Nov 3, 2017 at 5:13