From 84ee8133874ffec408013110b86d167417994e03 Mon Sep 17 00:00:00 2001 From: itscooleric Date: Sun, 8 Mar 2026 19:16:37 -0400 Subject: [PATCH 1/2] fix: handle pre-existing GID 1000 (lxd group) in Ubuntu 24.04 groupadd fails with exit 4 if the GID already exists. Fall back to renaming the existing group to 'clide' so the useradd step succeeds. Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b8f6491..4c8b92b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -78,7 +78,7 @@ ENV PATH="/opt/pyenv/bin:${PATH}" # Override at build time: CLIDE_UID=$(id -u) CLIDE_GID=$(id -g) docker compose build ARG CLIDE_UID=1000 ARG CLIDE_GID=1000 -RUN groupadd -g "${CLIDE_GID}" clide \ +RUN groupadd -g "${CLIDE_GID}" clide 2>/dev/null || groupmod -n clide "$(getent group "${CLIDE_GID}" | cut -d: -f1)" \ && useradd -m -l -s /bin/bash -u "${CLIDE_UID}" -g clide clide \ && mkdir -p /workspace \ && chown clide:clide /workspace \ From a61580318329b135040906bef3b0d8b82553e8bf Mon Sep 17 00:00:00 2001 From: itscooleric Date: Tue, 10 Mar 2026 01:43:09 +0000 Subject: [PATCH 2/2] feat: switch Claude Code to native installer (self-updating) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the npm-installed Claude Code CLI with the official native installer (curl -fsSL https://claude.ai/install.sh | sh). This eliminates the auto-update permission error that occurred because the npm global prefix was owned by root while claude runs as clide. The native binary at ~/.local/bin/claude is self-updating — no more version pinning or container rebuilds needed to get new Claude releases. Node.js is retained for Codex CLI and entrypoint config scripts. Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4c8b92b..6001d3b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,10 +39,6 @@ RUN ARCH="$(uname -m)" \ -o /usr/local/bin/ttyd \ && chmod +x /usr/local/bin/ttyd -# Install Claude Code CLI (pinned — bump ARG to upgrade) -ARG CLAUDE_CODE_VERSION=2.1.71 -RUN npm install -g "@anthropic-ai/claude-code@${CLAUDE_CODE_VERSION}" - # Install Codex CLI (pinned — bump ARG to upgrade) # hadolint ignore=DL3059 ARG CODEX_VERSION=0.112.0 @@ -71,7 +67,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pytest==9.0.2 \ ruff==0.15.5 -ENV PATH="/opt/pyenv/bin:${PATH}" +ENV PATH="/home/clide/.local/bin:/opt/pyenv/bin:${PATH}" # Create unprivileged user and set up workspace # UID/GID default to 1000 (standard first non-root user on Linux/macOS). @@ -100,6 +96,10 @@ COPY --chown=clide:clide .tmux.conf /home/clide/.tmux.conf # Switch to unprivileged user for user-scoped installs USER clide +# Install Claude Code CLI via native installer (self-updating, no npm dependency). +# Installs to ~/.local/bin/claude — auto-updates at runtime without sudo. +RUN curl -fsSL https://claude.ai/install.sh | sh + # Trust all directories for git operations. # Clide is a single-user dev sandbox — volume-mounted repos from the host # are often owned by a different UID (host user vs clide:1000), which causes