I am working at the edge of my knowledge here so this is more some thoughts rather than a solution.
When you access //192.168.10.10/homes/chris/Joplin
via /mnt/joplin-data
directly from your docker RasPi it has write permissions for the SMB shared folder (//192.168.10.10/homes/chris/Joplin
).
When you map that share (via /mnt/joplin-data
) to /var/lib/postgresql/data
in the Postgresql container, the container is using the share as if it were /var/lib/postgresql/data
.
Note the error does NOT say that the operation is not supported but that the operation is not permitted. It also says that /var/lib/postgresql/data
has wrong ownership and that the server must be started by the user that owns the data directory.
As @MrKanister pointed out in the other thread the Postgresql container writes to /var/lib/postgresql/data
as user 999
, which is the postgres
user within the postgres container. I am wondering if the write fails with Operation not permitted
is because user 999
has no write permissions for the //192.168.10.10/homes/chris/Joplin
SMB share.
So although the Postgresql container thinks it is writing to /var/lib/postgresql/data
it is actually writing to //192.168.10.10/homes/chris/Joplin
and user 999
is not allowed?
As a test, what happens if /homes/chris/Joplin
on 192.168.10.10
is set to allow writes from anyone?
The other possible alternative is to try mounting an NFS share on 192.168.10.10
as /mnt/joplin-data
on your RasPi. I believe that NFS shares do not use the same kind of permissions as SMB and access is authorised using the IP address of the connecting machine (your docker RasPi).
As stated above I am more thinking this through with you than offering definite solutions.
If anyone more knowledgeable can shed light on what is happening please put us right...