Skip to content

fix: update containerfile user/group management commands#379

Merged
mostlygeek merged 1 commit intomostlygeek:mainfrom
ryan-steed-usa:dockerfile-fix-user-group-creation
Nov 3, 2025
Merged

fix: update containerfile user/group management commands#379
mostlygeek merged 1 commit intomostlygeek:mainfrom
ryan-steed-usa:dockerfile-fix-user-group-creation

Conversation

@ryan-steed-usa
Copy link
Copy Markdown
Contributor

@ryan-steed-usa ryan-steed-usa commented Nov 3, 2025

This should fix the vulkan container build failures. The upstream vulkan containers use Ubuntu 24.04 and the others are still on 22.04. Apparently the adduser package is no longer installed by default.

  • Replace addgroup with groupadd for system group creation
  • Replace adduser with useradd for system user creation
  • Maintain same functionality while using more standard POSIX commands

Summary by CodeRabbit

  • Chores
    • Updated Docker container build process to use standard system utilities for creating container users and groups, improving build compatibility.

- Replace `addgroup` with `groupadd` for system group creation
- Replace `adduser` with `useradd` for system user creation
- Maintain same functionality while using more standard POSIX commands
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 3, 2025

Walkthrough

The Containerfile replaces Alpine Linux user/group management commands with standard GNU equivalents: addgroupgroupadd and adduseruseradd. The --no-create-home flag is removed from the user creation command, changing container user/group initialization behavior.

Changes

Cohort / File(s) Summary
Container user/group configuration
docker/llama-swap.Containerfile
Replace addgroup --system --gid $GID with groupadd --system --gid $GID; replace adduser --system --no-create-home --uid $UID --gid $GID --home $USER_HOME with useradd --system --uid $UID --gid $GID --home $USER_HOME; remove --no-create-home flag

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify that useradd/groupadd work as expected on the base image (may differ from Alpine's adduser/addgroup)
  • Confirm that removing --no-create-home does not alter expected home directory behavior or container filesystem layout
  • Check for any downstream dependencies or documentation that reference the previous commands

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: update containerfile user/group management commands' directly and clearly summarizes the main change: replacing Debian-specific user/group management commands with POSIX alternatives.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
docker/llama-swap.Containerfile (1)

18-19: Consider explicitly adding -M flag for clarity.

The migration to useradd is correct and addresses the Ubuntu 24.04 compatibility issue. However, the removal of the --no-create-home flag could lead to different behavior depending on the base image's /etc/login.defs configuration (specifically the CREATE_HOME setting).

While --system typically prevents home directory creation, explicitly adding -M or --no-create-home would better match the original intent and ensure consistent behavior across all base images.

Apply this diff to add explicit home directory prevention:

-      useradd --system --uid $UID --gid $GID \
+      useradd --system -M --uid $UID --gid $GID \
       --home $USER_HOME app; \

Note: This is optional since line 23 explicitly creates the directories with mkdir --parents, which will succeed regardless.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 12b69fb and 93031b2.

📒 Files selected for processing (1)
  • docker/llama-swap.Containerfile (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: ryan-steed-usa
Repo: mostlygeek/llama-swap PR: 368
File: docker/llama-swap.Containerfile:14-20
Timestamp: 2025-10-27T16:04:23.381Z
Learning: In docker/llama-swap.Containerfile, the user/group creation logic intentionally supports adding a non-root user (non-zero UID) to the root group (GID=0) as a valid configuration. This allows flexible UID/GID customization where users can specify only a UID or both UID and GID.
📚 Learning: 2025-10-27T16:04:23.381Z
Learnt from: ryan-steed-usa
Repo: mostlygeek/llama-swap PR: 368
File: docker/llama-swap.Containerfile:14-20
Timestamp: 2025-10-27T16:04:23.381Z
Learning: In docker/llama-swap.Containerfile, the user/group creation logic intentionally supports adding a non-root user (non-zero UID) to the root group (GID=0) as a valid configuration. This allows flexible UID/GID customization where users can specify only a UID or both UID and GID.

Applied to files:

  • docker/llama-swap.Containerfile
🔇 Additional comments (1)
docker/llama-swap.Containerfile (1)

16-16: LGTM! Correct migration to standard POSIX command.

The change from addgroup to groupadd correctly addresses Ubuntu 24.04 compatibility while maintaining the same functionality. groupadd is the standard command available across distributions.

@ryan-steed-usa
Copy link
Copy Markdown
Contributor Author

Closes #380

@mostlygeek mostlygeek merged commit b24467a into mostlygeek:main Nov 3, 2025
3 checks passed
0uep pushed a commit to lynxai-team/llama-swap that referenced this pull request Nov 21, 2025
)

- Replace `addgroup` with `groupadd` for system group creation
- Replace `adduser` with `useradd` for system user creation
- Maintain same functionality while using more standard POSIX commands
rohitpaul pushed a commit to rohitpaul/llama-swap that referenced this pull request Mar 29, 2026
)

- Replace `addgroup` with `groupadd` for system group creation
- Replace `adduser` with `useradd` for system user creation
- Maintain same functionality while using more standard POSIX commands
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