Conversation
Diggydogg
commented
Mar 5, 2026
The USER domjudge directive in the Dockerfile causes PID 1 to run as the domjudge user, preventing usermod from changing UID/GID at runtime. Changes: - Remove USER domjudge from Dockerfile - Add chown for /home/domjudge after usermod in start.sh - Run make commands as domjudge user via su -c (configure rejects root)
UIDs 1000-1005 and GIDs 1000-1001 are reserved by build-time users and groups, and cannot be used as custom values.
vmcj
left a comment
There was a problem hiding this comment.
I want to do a bit of testing but didn't find the time yet. I don't use the contributor container on my current laptop so need to pick my old setup. The other users of the container are currently busy so it will take a bit of time.
| COPY ["sudoers-domjudge", "/etc/sudoers.d/domjudge"] | ||
| RUN chmod 440 /etc/sudoers.d/domjudge | ||
|
|
||
| USER domjudge |
There was a problem hiding this comment.
The reason (or one of them) that I didn't merge this yet is mostly that I think we should want to run as domjudge, running as root even for a development container will get flagged by other systems. I wonder if podman will even allow it for example.
There was a problem hiding this comment.
Well, I understand your concern that removing USER domjudge line in dockerfile, the container would run as root, which could causes issues.
So I'm thinking maybe add new entrypoint script file that set domjudge user's UID/GID from env variables and fixes ownership.
still, user domjudge line in dockerfile be removed, also contianer be started as root but after the entrypoints sets UID/GID and execs gosu domjudge, the main process runs as domjudge + also need to add gosu lib in dockerfile
How about this way? let me know if this address your concern.
There was a problem hiding this comment.
I'll merge this as is and do some extra follow up when I have my testing system in order. It seems rootless podman really acts different from docker and this is only a development container it makes more sense to fix your issue first and then fix it properly later.