-
-
Notifications
You must be signed in to change notification settings - Fork 48
Description
The change to the script to run as the minecraft
user (instead of root
) is a good idea, but since the minecraft
user is not created in the Dockerfile, if you try to have the container run as user 999 (which appears to be the UID of the minecraft
user created by the startup script), the script fails at line 85 since that user does not exist (since it is not running as user 0, it skips the creation of the minecraft
user), giving this error:
whoami: cannot find name for user ID 999
The Dockerfiles need to be updated to create the minecraft
user, and could really just have the user set to minecraft
at the end of the script, something like this (I have not tested it yet):
RUN useradd -m -r -u 999 -g 999 -s /bin/bash minecraft
...
USER minecraft
Sidebar: I find it a bit odd to create a system user (the -r
flag) but then give it a shell (the -s
flag) since usually system users wouldn't get a shell (but this is how the startup script currently does it, with -r
and -s
). What is the reason for creating this as a system account, vs a regular account and ending up with a UID > 1000? I just added the -u
and -g
flags in the example code to be explicit.