-
-
Notifications
You must be signed in to change notification settings - Fork 249
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 uid not unique error when using root #3430
base: master
Are you sure you want to change the base?
Conversation
Thank you for creating a pull request! |
Signed-off-by: Woa <[email protected]>
f89aa4c
to
f4a4242
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable, but have tagged some other reviewers in case of any user/sec concerns that I'm missing.
@@ -324,7 +324,7 @@ printUserCreate(){ | |||
echo " | |||
ARG HostUID | |||
ENV HostUID=\$HostUID | |||
RUN useradd -u \$HostUID -ms /bin/bash build | |||
RUN useradd -o -u \$HostUID -ms /bin/bash build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's a good idea to allow for non-unique IDs here. In particular, allowing UID=0 to be non-unique. The fix is to not build with as root.
this has been stale for over a year, converting to "draft", if no longer needed please close. |
I was using Ubuntu 22.04 to build JDK17, but got error like this:
According to this error
#0 0.181 useradd: UID 0 is not unique
, I went to find the relevant parameters ofuseradd
, and tried to pass the parameter-o --non-unique
. Finally, the problem solved.After this change: