I have the following Dockerfile:
...
RUN groupadd -r myuser&& useradd -r -g myuser myuser
RUN mkdir /data && chmod a+rwx /data
USER myuser
...
Running the image with docker run works fine (I mean the user myuser has writing rights in the /data directory).
If I run the image with docker run -v /host/path:/data, the user myuser cannot write in the /data directory.
Question: How to give the user myuser permission to write in the /data directory in the second case?
The reason is the fact that the /host/path directory is own by root and the user myuser does not have permission to write in such directories.