My question might be completely inane but please be kind, I’ve had quite a bruising experience with Docker so far.
I want to, at runtime, mount a directory from my mac into the container.
Expected behaviour
Docker for Mac Beta mounts a volume no matter where it’s based.
Actual behaviour
It seems to me that files have to be under /Users - which seemed to be the case when I was using Docker Machine ( for some reason to do with the VM it was running on apparently), but I expected the beta would allow any directory to be mounted?
Information
OS X: version 10.11.5 (build: 15F34)
Docker.app: version v1.11.1-beta13.1
Running diagnostic tests:
[OK] Moby booted
[OK] driver.amd64-linux
[OK] vmnetd
[OK] osxfs
[OK] db
[OK] slirp
[OK] menubar
[OK] environment
[OK] Docker
[OK] VT-x
Docker logs are being collected into /tmp/20160531-160923.tar.gz
Most specific failure is: No error was detected
Your unique id is: REDACTED
Please quote this in all correspondence.
Steps to reproduce the behavior
I have a project called foo. I have copied this project into two places - $HOME/foo and /var/www/labs/foo. I’m using the postgres image, although I get identical results no matter what image I use.
➜ foo git:(ci) ✗ docker run -v $HOME/foo:/foo:ro postgres ls /foo
package.json
… other files that I’d expect to see
➜ foo git:(ci) ✗ docker run -v /var/www/labs/foo:/foo:ro postgres ls /foo
integration-test
… Not sure where it’s getting this - this is another directory in my project.