Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Docker user warning UID is greater than SYS_UID_MAX #1056

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

z017
Copy link

@z017 z017 commented Nov 21, 2024

Description

Currently docker entrypoints create users as system users by using the -r flag of useradd:

useradd -r -u $USERID -g $GROUPID bitcoin

The default user uid is 1000 greater than SYS_UID_MAX resulting in the following warning:

useradd warning: bitcoin's uid 1000 is greater than SYS_UID_MAX 999

To fix the warning:

  • The -r flag was removed.
    • That flag also avoid home directory creation and password aging information in /etc/shadow.
  • The -M flag was added to avoid home directory creation.
  • And the password aging information is not necessary because the user has no password.

References

@jamaljsr
Copy link
Owner

@z017 Thanks for proposing this.

How can I reproduce this issue? I'm on and ARM Mac and do not see this warning logged when running the nodes in Polar.

@z017
Copy link
Author

z017 commented Nov 30, 2024

I forgot to explain how I got the warning!

I'm using the docker images to build a CI test. I got the warning from the docker logs.

From a Windows Linux Subsystem running the following I can see the warning:

docker run -it --rm polarlightning/bitcoind:28.0 -regtest

Output:

...
Status: Downloaded newer image for polarlightning/bitcoind:28.0
adding user bitcoin (1000:1000)
useradd warning: bitcoin's uid 1000 is greater than SYS_UID_MAX 999
/entrypoint.sh: assuming arguments for bitcoind
Running as bitcoin user: bitcoind -regtest
2024-11-30T03:02:58Z Bitcoin Core version v28.0.0 (release build)
2024-11-30T03:02:58Z Script verification uses 7 additional threads
...

PD: thansk to you! Polar is an amazing project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants