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:
@@ -57,6 +57,8 @@ jobs:
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
TOOLS_CACHEBUST=${{ github.run_id }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
platforms: linux/amd64
|
||||
|
||||
@@ -100,6 +100,8 @@ jobs:
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.tag }}
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||
build-args: |
|
||||
TOOLS_CACHEBUST=${{ github.run_id }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
platforms: linux/amd64
|
||||
|
||||
+7
-1
@@ -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') && \
|
||||
|
||||
Reference in New Issue
Block a user