Mapped volumes should be accessible to docker if they are accessible to the current user.
Host directories owned by root seem to not be usable when mounted.
I’ve mounted 2 volumes owned by root mounted via docker-compose and neither seems to be able to accessible (either read or write). I have them set up in docker-compose.yml as follows.
postgres: ... volumes: - /data/pgdata:/pgdata nginx: ... volumes: - /certs:/certs
In the /certs folder I placed 2 cert files. After starting the containers, and having nginx shutdown, I exec’ed in and found the /certs dir correctly mapped. However, it did not appear to contain any cert files. Note: /certs is owned by root, the files are owned by me.
For postgres, on startup, no data files are created.
I then changed the directories to be off of ~ (~/certs, and ~/data/pgdata) and everything worked as expected.
OS X: version 10.11.5 (build: 15F28b) Docker.app: version v1.11.0-beta9 Running diagnostic tests: [OK] docker-cli [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/20160430-082638.tar.gz Most specific failure is: No error was detected Your unique id is: 86DF8E94-5D0E-4814-8A71-11F007590D3D Please quote this in all correspondence.