Skip to content

fix: use groupmod/usermod -o to allow non-unique GID/UID on Mac#2

Draft
andreweacott wants to merge 1 commit into
mainfrom
fix/docker-gid-mac
Draft

fix: use groupmod/usermod -o to allow non-unique GID/UID on Mac#2
andreweacott wants to merge 1 commit into
mainfrom
fix/docker-gid-mac

Conversation

@andreweacott
Copy link
Copy Markdown

@andreweacott andreweacott commented May 8, 2026

Motivation

sandcastle docker build-image fails on macOS because the host user's GID (20, the staff group) collides with GID 20 (dialout) already present in the node:22-bookworm Debian base image. groupmod refuses to reassign a GID that already exists.

Fixes mattpocock#609.

Note: mattpocock#613 is an independent PR upstream with the same fix. If that lands first, this branch becomes redundant.

Proposed Changes

  • Add -o (--non-unique) to groupmod and usermod in all four Dockerfile templates in InitService.ts, and in the repo's own .sandcastle/Dockerfile
  • -o allows a GID/UID to be shared between two entries — harmless here since dialout is unused in agent containers
  • One-flag fix; no shell scripting, no hardcoded group names

Closes mattpocock#609 on mattpocock/sandcastle.

macOS hosts typically have UID 501 / GID 20 (staff). The Debian
node:22-bookworm base image already has GID 20 (dialout), so groupmod
refuses to reassign it. Adding -o (--non-unique) lets both groups share
the GID — harmless since dialout is unused in agent containers. Same
flag on usermod guards against UID collisions.
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.

Docker image fails to build on Mac OS

1 participant