I have a container running a PHP application and the
MacOS has some mounting problems because of the differences in
group owning the file versus
group modifying/reading the file. As a workaround, do the following (preferably using the latest version) of Docker,
$ brew install docker-machine-nfs $ docker-machine start yourdockermachine $ docker-machine-nfs yourdockermachine --shared-folder=/Users --nfs-config="-alldirs -maproot=0"
You can change the name of
yourdockermachine as you like. Also, you have the ability to change the shared folder you want to map. The above option is the best bet and works in all cases. I would suggest not changing that so that you don't mess around with system files.
After the above setup, make sure you provide appropriate read, write, execute permissions to your files and folders.
NOTE: Dependencies for above procedure are
docker-machine (or the complete docker toolbox for simplicity)
UPDATE 1: Docker for Mac Beta is in private invite phase. It runs Docker natively on Mac on top of xhyve Hypervisor. It would mean, no more permission errors and improved performance.
UPDATE 2: Docker for Mac is now in Public Beta. The underlying technology remains the same and the VM is completely managed by the Docker service. The version as of this writing is
1.12.0-rc2 which works seamlessly with OS X without any intervention of