Userid mapping in docker

In my docker installation the user “mayan” is mapped to uid 1000 and gid 1000. This id’s are assigned to an other user on the host.
Is this intended or should the user mayan within the docker app get a different or new id?
On my host, the user mayan is already defined from the direct installation.
What’s the best way to handle this?
Regards,
Johann

I have not had that problem, but this question raised my curiosity. I found this when reading the docker docs and it may be what you need. I don’t have time to test this my self at the moment.

Ken,

thank you for the information and the link.
In the moment, this is not a serious problem for my installation. As mentioned, seems that the user “mayan” is not further necessary as using the docker installation.
It seems to me, that the user and userid’s are defined in the container and can not be modified easy by the yaml-file.
Regards,
Johann

You can make the container use a different user and group (e.g. to 1012) by passing the environment variables:

MAYAN_USER_GID=1012
MAYAN_USER_UID=1012

I would consider this a good practice in general however be aware that this will potentially take the container a very long time to start as it is chmodding all Mayan and document files upon startup. I wanted to try a different approach than the one implemented in the entrypoint script but I did not find the time to do so. For the moment I am also back to using the default user.

1 Like