Auto-update Claude Code on container boot#42
Open
ziweiwu wants to merge 1 commit into
Open
Conversation
The image bakes Claude Code in at build time, so users on a published image are pinned to whatever version was current when the image was built. This adds a best-effort `claude update` step to the entrypoint that runs as the claude user on every boot, gated by CLAUDE_AUTO_UPDATE (default true) so air-gapped or pinned environments can opt out.
Author
|
Verified locally against Default ( Claude Code updated from the version baked into the published image (2.1.100) to the current release (2.1.138), then s6-overlay started cloudcli/xvfb cleanly. Opt-out ( Update step skipped, no Failure path (no network) wasn't exercised live, but the logic is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
coderluii/holyclaude:latestare pinned to whatever Claude Code version was current at build time.claude updatestep toentrypoint.shthat runs as theclaudeuser on every boot, so containers pick up new Claude Code releases without an image rebuild.CLAUDE_AUTO_UPDATEenv var (defaulttrue). Set it tofalsefor air-gapped or version-pinned environments.Failures are logged via
[claude-update]prefix and never block startup, so a transient network issue or upstream outage won't break boot.Files touched
scripts/entrypoint.sh— new auto-update block, runs after first-boot bootstrap and before the~/.claude.jsonpersistence loopdocker-compose.yaml— documents the new env var in the quick-start filedocker-compose.full.yaml— documents the new env var alongside the other performance optionsTest plan
docker compose up -don a fresh build — observe[entrypoint] Checking for Claude Code updates...followed by[claude-update]-prefixed output, and confirmdocker exec -u claude holyclaude claude --versionreports the latest releaseCLAUDE_AUTO_UPDATE=false docker compose up -d— confirm the update step is skipped