docker-ejabberd icon indicating copy to clipboard operation
docker-ejabberd copied to clipboard

Ability to set custom GID and UID

Open Mistra opened this issue 1 year ago • 1 comments

Hello. I stumbled upon the same issue found in ticket #10 I'm not necrobumping a closed issue but here the problem I'm facing is similar. I'm using another user (actually, my user, GID 1000 and UID 1000) to run a Docker image that allows me to retrieve letsencrypt certificates. The problem with these certificates is that some keys have and (must remain with) permissions set to 400. The only way to read them mounting the folder would be to change the folder user in the host making some automatism more tricky.

Long story short, the problem comes from the fact that GID and UID 9000 is an hardcoded value in the Dockerfile. Would it be possible to allow the image to set a custom UID/GID from the environment for the user ejabberd, keeping 9000 as the default? I think I can provide a PR for this, in case, would you accept it (ofc after a review)?

Mistra avatar Dec 22 '24 23:12 Mistra

Right, in the Dockerfile that builds the ecs container image, the ejabberd files are owned by ejabberd:ejabberd which have hardcoded IDs 9000:9000.

Notice that, in the Dockerfile that builds the ejabberd container image, the files IDs are defined in an argument, and set to 9000:9000 by default: https://github.com/processone/ejabberd/blob/7d5413ce95f3e9395f8d584469c5e016ebaaa689/.github/container/Dockerfile#L8

I think I can provide a PR for this, in case, would you accept it (ofc after a review)?

Yes, if you can provide a PR, I'd be happy to try it and probably merge it.

badlop avatar Dec 30 '24 18:12 badlop