Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ All images extend a shared base (`base/Dockerfile` — `debian:trixie`) and run
- **MCP servers**: Serena, Context7, Automem
- **GSD** (Get Shit Done for Claude Code)
- **Agent Browser** + Chrome
- **Docker** CLI + Compose plugin (`docker`, `docker compose`) — mount the host socket to use
- **Docker** CLI + Compose plugin (`docker`, `docker compose`) — mount the host socket to use; works without `sudo` (the entrypoint automatically matches the socket's GID)
- **CLI tools**: git, curl, wget, vim, nano, jq, tmux, xclip, openssh-client, gnupg, cmake, less, unzip, gh, pnpm, tsx
- **Search & file tools**: ripgrep, fd-find, fzf, bat, tree
- **PDF tools**: poppler-utils (pdftotext, pdfinfo, etc.)
Expand Down
4 changes: 4 additions & 0 deletions base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,8 @@ RUN agent-browser install --with-deps

RUN chown -R dev:dev /home/dev

COPY scripts/docker-sock-fix.sh /usr/local/bin/docker-sock-fix.sh
RUN chmod +x /usr/local/bin/docker-sock-fix.sh
ENTRYPOINT ["docker-sock-fix.sh"]

USER dev
28 changes: 28 additions & 0 deletions scripts/docker-sock-fix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
# Fix Docker socket permissions so the dev user can use docker without sudo.
# When /var/run/docker.sock is bind-mounted from the host, its GID may not
# match the container's "docker" group. This script updates the container's
# docker group GID to match the socket's GID, then re-execs with the new group.

SOCKET="/var/run/docker.sock"

if [ -S "$SOCKET" ]; then
SOCK_GID=$(stat -c '%g' "$SOCKET")
CUR_GID=$(getent group docker | cut -d: -f3)

if [ "$SOCK_GID" != "$CUR_GID" ]; then
# Check if another group already uses this GID
EXISTING=$(getent group "$SOCK_GID" | cut -d: -f1)
if [ -n "$EXISTING" ] && [ "$EXISTING" != "docker" ]; then
sudo groupmod -g 99999 "$EXISTING"
fi
sudo groupmod -g "$SOCK_GID" docker
fi

# Re-exec with updated docker group if not already applied
if ! id -G | tr ' ' '\n' | grep -q "^${SOCK_GID}$"; then
exec sg docker "$(printf '%q ' "$@")"
fi
fi

exec "$@"
Loading