B
B
Bone2020-11-12 21:49:29
Docker
Bone, 2020-11-12 21:49:29

Windows + Docker. How to create files from under windows with the rights of a specific user?

I'm trying to figure out how to use docker in windows 10. It's docker for windows, via wsl2. Let's say I start the container like this docker run -v .:/data. The container runs php-fpm on behalf of www-data. Accordingly, it is necessary that the site files also belong to the www-data user. The problem is that if I create files in a shared folder from under windows (for example, through phpstorm), then they belong to root in the container, and, accordingly, php-fpm starts access errors. It looks like I'm doing something wrong, but I can't figure out what. I want the whole infrastructure to work in the docker, and from under windows I just edit the files in the shared folder, as is the case with some xampp.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question