Hi
I have an nginx Docker container that needs to access a directory on an auto-mounted external hard disk (/media/mydisk/directory). Here's the mount:
Bash
$ mount | grep mydisk
/dev/sda2 on /var/media/mydisk type exfat (rw,nosuid,nodev,noexec,noatime,fmask=0022,dmask=0022,iocharset=utf8,errors=remount-ro)
$ ls -ld /media/mydisk/directory
drwxr-xr-x 2 root root [...]
The directory is available to the container with a bind mount (-v /media/mydisk/directory:/directory) and I can access it. I can however only read from it. But my container needs write access.
Running whoami from PHP returns "nobody", and thus is_writable("/directory") says "false". I think it's basically the same problem reported here: Docker containers and permissions in LE - except that I can't format the drive with extfs.
What options do I have?
- Is it possible to have the drive auto-mounted with 777? (dmask=0000, but how?)
- Should/can I run nginx as root? (tried to set user root; in config/nginx/nginx.conf, but that had no effect)
- Maybe I could modify the sudoers and run a command from within the container with sudo? (a test was unsuccessful)
- Any other ideas?
Thanks, Steffen