I’m running the official
owncloud image. This is basically a PHP application running under Apache that lives in
/var/www/html. It writes (potentially quite a lot of) data to
/var/www/html/data. It runs as the user
www-data (UID 33).
I’m running Docker 1.9.1 on OSX using docker-machine. Everything should be completely up to date.
I want to mount a directory from my NAS onto
/var/www/html/data so that the data is stored on my NAS and not locally. I’ve done this with a mount in docker-compose.
There are two problems with this:
- With docker-machine on OSX, anything outside /Users isn’t mountable by default (or rather, the mount comes from the VM, not OSX). I tried to work around this by symlinking
/Volumes/backup/owncloud(the intended target) to
~/docker/owncloudand mounting this.
- I get a Permission Denied error in owncloud because it can’t write to the relevant directory, due to the change in ownership. I also think the symlinking gets in the way of trying to
chownthe directory to UID 33 (which doesn’t exist on the Mac or the NAS).
What is the best way to achieve this?