Skip to content

Rebuild does not upgrade Claude Code due to layer caching #74

@just-meng

Description

@just-meng

Rebuilding the container image via ./setup-yolo.sh --build=yes does not actually upgrade Claude Code to the latest npm version. Podman (and Docker) cache the RUN npm install -g @anthropic-ai/claude-code@latest layer, so unless the Dockerfile itself changes, the cached layer is reused and the old version persists.

This means users who rebuild after a new Claude Code release (e.g., one that adds support for newer models) silently get the stale cached version instead of the latest.

Steps to reproduce

  1. Build the image: ./setup-yolo.sh --build=yes
  2. Wait for a new @anthropic-ai/claude-code release on npm
  3. Rebuild: ./setup-yolo.sh --build=yes
  4. Inside the container, run claude --version — still shows the old version

Workaround

podman build --no-cache -t con-bomination-claude-code images/

Fix

Add a cache-busting ARG before the npm install layer and pass a unique value (epoch seconds) at build time so the layer is always re-evaluated when building via setup-yolo.sh.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions