Bust layer cache to ensure Claude Code upgrades on rebuild#75
Conversation
|
|
||
| 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)") |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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>
59d202f to
f886a11
Compare
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! |
|
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. |
Summary
CLAUDE_CACHEBUSTbuild arg before thenpm installlayer in the Dockerfile so Podman doesn't reuse a stale cached layer--build-arg CLAUDE_CACHEBUST=$(date +%s)automatically insetup-yolo.shwhen buildingFixes #74
Test plan
./setup-yolo.sh --build=yesand verify the build log showsnpm installactually running (not cached)claude --versioninside the container matches the latest npm version