Skip to content

fix(BA-8638): use busybox addgroup instead of usermod in the Alpine entrypoint - #15903

Merged
fregataa merged 2 commits into
mainfrom
BA-8638-alpine-usermod
Oct 22, 2026
Merged

fregataa merged 2 commits into
mainfrom
BA-8638-alpine-usermod

Conversation

@seedspirit

Copy link
Copy Markdown
Contributor

Summary

  • The Alpine branch of entrypoint.sh creates users and groups with busybox adduser/addgroup, but adds the user to shadow and grpread with usermod -aG. busybox has no usermod, so on Alpine images without the shadow package (e.g. python:3.12-alpine) those three lines fail with usermod: not found and the user never joins the groups.
  • Replace them with busybox addgroup <user> <group>, which does the same thing. Installing shadow at container start is avoided: it needs outbound network and slows every session start.
  • The root-mode branch (usermod with an unset $USER_NAME) is a separate problem and is left untouched.

Test plan

Ran the whole script in python:3.12-alpine with LOCAL_USER_ID=501 LOCAL_GROUP_ID=501:

  • New user path: before → usermod: not found ×2, no groups; after → groups=501(work),42(shadow),1002(grpread)
  • Image already has a uid 501 user: before → usermod: not found; after → that user is in 42(shadow)
  • Non-Alpine branch unchanged (diff is confined to the /bin/ash branch)

Resolves BA-8638

🤖 Generated with Claude Code

…ntrypoint

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@seedspirit
seedspirit marked this pull request as ready for review October 20, 2026 05:59
@seedspirit
seedspirit requested a review from a team as a code owner October 20, 2026 05:59
Copilot AI balanced review requested due to automatic review settings October 20, 2026 05:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@fregataa
fregataa merged commit 5b56777 into main Oct 22, 2026
33 of 34 checks passed
@fregataa
fregataa deleted the BA-8638-alpine-usermod branch October 22, 2026 07:51
lablup-octodog added a commit that referenced this pull request Oct 22, 2026
…ntrypoint (#15903) (#15999)

Co-authored-by: Bokyum Kim | 김보겸 <bkkim@lablup.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
lablup-octodog added a commit that referenced this pull request Oct 22, 2026
…ntrypoint (#15903) (#16000)

Co-authored-by: Bokyum Kim | 김보겸 <bkkim@lablup.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS ~10 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants