D
D
Dmitry2016-12-23 12:56:30
Docker
Dmitry, 2016-12-23 12:56:30

Docker is it possible to map uid in container and host?

Hello All!
There is an nginx image that is launched through docker-compose and catalogs with configs and logs are mapped inside. Today the question arose - if inside the container I create a file inside the directory that is mapped from the host, then such a file is obtained with root:root rights, this is generally logical for the container - since it works from root. But now the problem is that the files that appear in the directory on the host and are created inside the container were not under root:root , but let's say dima:dima, that is, the owner was the user who launched the container. I can't figure out how to do this. Thanks for any hints

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Max, 2016-12-23
@MaxDukov

set the SUID-SGID bits on the directory, and set the owner of the directory to dima.dima

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question