K
K
ko220122021-02-21 19:59:21
Windows
ko22012, 2021-02-21 19:59:21

Windows. Docker. volume. user owner?

How to transfer user rights to the project on Windows in docker container?
Saw solutions for Linux, by passing uid, gid. But for Windows, I don't know how it can be applied.

I have created a user in the container and I want them to stay with it. But when I mount the folder from the host machine, I get the owner root.

Or leave it under windows and run php-fpm as root?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
ko22012, 2021-02-22
@ko22012

Generally. don't specify the "USER" directive in the dockerfile and work as root.

C
CodingStub, 2021-02-21
@vgluhov

A slightly perverse solution, but you can try.
In the container, create a user with the same uid/gid as the host user. Next, start the container as usual (the launch will happen as the root user). After that, start all services (php-fpm, nginx, etc.) and use su 'user' to switch to the created user.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question