Skip to content

docs: fix docker.sock group-add recipe on macOS - #7

Merged
czpython merged 1 commit into
mainfrom
docs-macos-docker-sock
Aug 9, 2026
Merged

docs: fix docker.sock group-add recipe on macOS#7
czpython merged 1 commit into
mainfrom
docs-macos-docker-sock

Conversation

@czpython

Copy link
Copy Markdown
Owner

The local-sandbox docker run recipe used stat -f '%g' /var/run/docker.sock as the macOS fallback for --group-add. That is wrong twice over on macOS:

  • /var/run/docker.sock is a symlink, and BSD stat -f '%g' returns the symlink's gid (1, daemon), not the target's.
  • Regardless, Docker Desktop mounts the socket into the container as root:root mode 0660, so only group 0 grants access — the host socket's own gid is irrelevant.

Branch the recipe: stat -c '%g' on Linux, plain --group-add 0 on macOS, with one sentence of why.

Verified empirically in the druks install.sh, which writes gid 0 on Darwin and stat -c '%g' on Linux.

BSD stat -f '%g' on /var/run/docker.sock returns the symlink's gid, and
Docker Desktop mounts the socket into containers as root:root 0660 — only
group 0 grants access. Branch the recipe: stat -c '%g' on Linux, plain
--group-add 0 on macOS.
@czpython
czpython merged commit d223a1c into mainAug 9, 2026
6 checks passed
Sign up for freeto 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.

1 participant

@czpython