Skip to content

Fix Dockerfile to handle non-unique GID for macOS compatibility#657

Open
Prajeet-Shrestha wants to merge 1 commit into
mattpocock:mainfrom
Prajeet-Shrestha:fix/dockerfile-gid-conflict-macos
Open

Fix Dockerfile to handle non-unique GID for macOS compatibility#657
Prajeet-Shrestha wants to merge 1 commit into
mattpocock:mainfrom
Prajeet-Shrestha:fix/dockerfile-gid-conflict-macos

Conversation

@Prajeet-Shrestha
Copy link
Copy Markdown

Fixes #656

Problem

On macOS, most user belongs to a group which has GID 20. Sandcastle passes this GID to docker build, but inside the node:22-bookworm image, GID 20 is already used by another group, because of that it was causing the issue.

Fix

Added --non-unique to both groupmod and usermod in Dockerfile for all the agents.

Before:
RUN groupmod -g $AGENT_GID node && usermod -u $AGENT_UID -g $AGENT_GID -d /home/agent -m -l agent node

After:
RUN groupmod -g $AGENT_GID --non-unique node && usermod -u $AGENT_UID -g $AGENT_GID -d /home/agent -m -l agent --non-unique node

@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

@Prajeet-Shrestha is attempting to deploy a commit to the Matt Pocock's projects Team on Vercel.

A member of the Team first needs to authorize it.

@hlynurstef
Copy link
Copy Markdown

I've already put up a PR with the same fix: #613

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 build fails on macOS with exit code 4: GID 20 conflict in Dockerfile

2 participants