At least in the *nix world the ownership (i.e. uid and gid) of a file/folder on a mounted filesystem doesn't change, it is the actual ownership from the host exporting that filesystem (if ownership is supported by that filesystem).
Note that if the container has different user/group names matching the uid/gid of the file/folder they will appear under the container's names in ls -l
, not as the host's names (or as numbers if no container names match the respective IDs).
So if on the host machine the folder is owned by root, it will also be owned by root in the container (in other words it's nothing "special" about it being owned by root vs other users). The only way to allow the container app to write to the filesystem is to change the ownership accordingly on the host system (or give it other
write permissions).
Maybe worth noting that if the host's filesystem itself doesn't support ownership, it can still be "faked" inside the container using the uid and gid mount options (in the *nix world). See Ownership of a mount point.