I want to provide write access to a non-root user in docker container for a volume mounted on the host. I have same non-root user and group inside container and host as well. While running the container I mount a host volume to it
-v /some/folder:/some/folder. I am doing this because my application running inside the docker container needs to write files to the mounted host folder. But since I am running my application as a non-root user, it doesn’t have permission to write to that folder.
Also I this mounted folder permission is got changed inside the container automatically.
I have given assigned below user and group as an owner to this folder on the host:
but inside the container it is showing below user and group as an owner to this folder:
Host details are mentioned below:
Kernel Version: 5.4.0-135-generic
Operating System: Ubuntu 20.04.5 LTS
Storage Driver: overlay2