Skip to content

Bust layer cache to ensure Claude Code upgrades on rebuild#75

Merged
asmacdo merged 1 commit into
con:mainfrom
just-meng:bf-cache-bust-claude-upgrade
Jun 2, 2026
Merged

Bust layer cache to ensure Claude Code upgrades on rebuild#75
asmacdo merged 1 commit into
con:mainfrom
just-meng:bf-cache-bust-claude-upgrade

Conversation

@just-meng

Copy link
Copy Markdown
Contributor

Summary

  • Add CLAUDE_CACHEBUST build arg before the npm install layer in the Dockerfile so Podman doesn't reuse a stale cached layer
  • Pass --build-arg CLAUDE_CACHEBUST=$(date +%s) automatically in setup-yolo.sh when building

Fixes #74

Test plan

  • Run ./setup-yolo.sh --build=yes and verify the build log shows npm install actually running (not cached)
  • Confirm claude --version inside the container matches the latest npm version

Comment thread setup-yolo.sh

TZ=$(timedatectl show --property=Timezone --value 2>/dev/null || echo "UTC")
BUILD_ARGS=(--build-arg "TZ=$TZ")
BUILD_ARGS=(--build-arg "TZ=$TZ" --build-arg "CLAUDE_CACHEBUST=$(date +%s)")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is cute enough: it will allow quick rebuilds within the same day while ensuring that otherwise we have everything beyond 'apt' installations earlier, up to date... wdyt @asmacdo ?

@asmacdo asmacdo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool with me. "partial cache" for quick builds and more-updated claude code.

Looks like it branched from an old version of main though, theres a conflict. @just-meng could you rebase?

The `npm install -g @anthropic-ai/claude-code@latest` layer was cached
by Podman, so rebuilding via `setup-yolo.sh --build=yes` silently
reused the old version instead of fetching the latest. Add a
CLAUDE_CACHEBUST build arg (set to epoch seconds) before the npm
install layer so it is always re-evaluated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@just-meng just-meng force-pushed the bf-cache-bust-claude-upgrade branch from 59d202f to f886a11 Compare June 2, 2026 07:26
@just-meng

Copy link
Copy Markdown
Contributor Author

This is cool with me. "partial cache" for quick builds and more-updated claude code.

Looks like it branched from an old version of main though, theres a conflict. @just-meng could you rebase?

Ah that was me pulling from origin instead of upstream ... now I understand why some people prefer to call the real project original, and not the fork.

Rebased, all clean!

@asmacdo

asmacdo commented Jun 2, 2026

Copy link
Copy Markdown
Member

Ah yeah I did that many times so I adopted a convention to never use origin since it changes depending on where you cloned from. I have upstream and austin so it's never ambiguous.

@asmacdo asmacdo merged commit a948f23 into con:main Jun 2, 2026
5 of 6 checks passed
@just-meng just-meng deleted the bf-cache-bust-claude-upgrade branch June 2, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rebuild does not upgrade Claude Code due to layer caching

3 participants