Fix uid not unique error when using root#3430
Conversation
|
Thank you for creating a pull request! |
Signed-off-by: Woa <me@wuzy.com>
f89aa4c to
f4a4242
Compare
karianna
left a comment
There was a problem hiding this comment.
Seems reasonable, but have tagged some other reviewers in case of any user/sec concerns that I'm missing.
| 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.
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: