
Did you manage to solve this problem? I am also having this in a container.
I wonder if I have to create a user in my NAS that matches a user in the docker container for it to be able to write properly. Currently, my share is mounted as the user 'pi'.
Good news bro! I found a solution.
I did this because I am running the Pi with an 8GB SD card and I plan to run many containers in it.
Solution: I moved the whole docker file structure to my samba share in the NAS and sym-linked it.
Here's how you do it.
-
Stop Docker completely
sudo service docker stop
-
Check which other docker processes are running:
sudo ps faux | grep docker
-
Kill said processes:
sudo kill <ProcessID>
-
Back up existing docker:
sudo tar -zcC /var/lib docker > /NAS/MOUNTED/SHARE/PATH/dockerBackup.tar.gz
-
Move existing docker to File Share (You might see a lot of errors related to symbolic links, it's OK)
sudo mv /var/lib/docker /Docker
-
Make a symlink to the fileshare
sudo ln -s /NAS/MOUNTED/SHARE/PATH/docker /var/lib/docker
-
Check that it is correct now
sudo ls -al /var/lib/docker/
-
Restart docker
sudo service docker start
Here's the result in my NAS:
Permission wise, there's no difference. I have the NAS fileshare mounted using a user that has read/write permissions for that share.
Oof, that's going to slow as a snail and fraught with issues.
Save your sanity and just get a bigger SD Card.
It is very possible. However, it is running smoothly so far.
Additionally, it allows me to back up my whole docker configuration in a raided, storage grade device instead of the SD card. 
And now your Docker installation is based on a networked filesystem. Did you update the docker daemon to know that it's not on a local filesystem?
No sir, I did not make changes to the daemon. It believes it is working on a local filesystem and is using the same path.
How have you mounted the remote filesystem? What protocol?
Edit: Ah, SAMBA with a symbolic link. I don't think SMB mounts will work well with needed capabilities. Great to try it but I don't think it's going to do anything but cause headaches.
"Edit: Ah, SAMBA with a symbolic link. I don't think SMB mounts will work well with needed capabilities. Great to try it but I don't think it's going to do anything but cause headaches."
Feel free to delete this thread, sir. It won't let me.