How to give non-root user in Docker container access to a volume mounted on the host : <p>I am running my application in a Docker container as a non-root user. I did this since it is one of the best practices. However, while running the container I mount a host volume to it <code>-v /some/folder:/some/folder</code> . 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</p>

<p><strong>Question</strong></p>

<p>Is it possible to give a nonroot user in a docker container access to the hosted volume?</p>

<p>If not, is my only option to run the process in docker container as root?</p>
