fix: bust Docker cache for tools that fetch latest versions

The native Claude Code installer (and other tools) fetch "latest" at
build time, but Docker layer caching serves stale layers because the
RUN command text never changes. Add TOOLS_CACHEBUST build arg with
github.run_id so every CI run re-downloads fresh tool binaries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
DevContainer User
2026-02-25 16:16:14 +00:00
parent 19d47da079
commit 6dd560f2ad
3 changed files with 11 additions and 1 deletions
+7 -1
View File
@@ -64,11 +64,17 @@ RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
# Install Happy Coder globally via npm
RUN npm install -g happy-coder
# Cache-bust: tools below fetch "latest" at build time — a changing ARG
# forces Docker to re-run these layers instead of serving stale cache.
ARG TOOLS_CACHEBUST=0
# Install Claude Code via native installer (no Node.js dependency)
RUN CLAUDE_VERSION=$(curl -fsSL https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/latest) && \
echo "Installing Claude Code ${CLAUDE_VERSION}" && \
curl -fsSL "https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/${CLAUDE_VERSION}/linux-x64/claude" \
-o /usr/local/bin/claude && \
chmod +x /usr/local/bin/claude
chmod +x /usr/local/bin/claude && \
claude --version
# Install OpenCode AI coding agent
RUN OPENCODE_VERSION=$(curl -sL https://api.github.com/repos/opencode-ai/opencode/releases/latest | jq -r '.tag_name') && \