mviereck / x11docker

Run GUI applications and desktops in docker and podman containers. Focus on security.
MIT License
5.61k stars 377 forks source link

Add new docker user to group #497

Open jcalfee opened 1 year ago

jcalfee commented 1 year ago

I have a few containers that like to use user / group ID 1001 instead of the more standard 1000, however, I also mostly use 1000 at the same time. Can you recommend a good way to add the new internal x11 docker user (1000) to group (1001) upon container start? I do not need sudo or root other than this one user modification.

This would be similar to adding RUN usermod -a -G 1001 username to the Dockerfile, however, I can't do this because the user does not exist yet (it is created by x11docker later).

thank you... :pray:

mviereck commented 1 year ago

You could try option --runasroot 'command'. I am not sure yet if the command is executed before or after the setup of /etc/passwd.