Add claude-latest binary via multi-stage build - #545
openshift-merge-bot[bot] merged 9 commits into
Conversation
Add a builder stage that installs Claude Code from the "latest" RPM channel and copies the standalone binary into the final image as /usr/local/bin/claude-unstable. The main stage continues to install from the stable channel. The latest repo is disabled in the main stage's dnf install to prevent accidental version mixing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe Dockerfile is converted to a multi-stage build. A new ChangesClaude Code Latest Installation via Multi-Stage Build
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 10✅ Passed checks (10 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@images/repos/claude-code-latest.repo`:
- Line 4: The `enabled=1` setting in the claude-code-latest.repo file keeps the
latest channel enabled by default in the final image. Change this setting to
`enabled=0` on line 4 to disable the claude-code-latest repository by default,
ensuring that derived images do not unexpectedly use the unstable latest channel
when running dnf commands, even without explicit disablerepo flags.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 05ce0ad3-ad25-4c6a-bbaf-eefe71aab91e
📒 Files selected for processing (2)
images/Dockerfileimages/repos/claude-code-latest.repo
Set enabled=0 in the repo file so the latest channel doesn't leak into downstream dnf usage in derived images. The builder stage explicitly enables it with --enablerepo. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ensure the builder stage only pulls from the latest channel by explicitly disabling the stable claude-code repo. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The ART dnf wrapper in CI doesn't recognize repos added via COPY, so --enablerepo='claude-code-latest' fails with "Unknown repo". Instead, flip enabled=0 to enabled=1 in the repo file before installing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The ART dnf wrapper redirects repo lookups to /etc/yum.repos.art/ci, ignoring files in /etc/yum.repos.d/. Setting append mode tells it to include our repos alongside the CI ones, matching the main stage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The --enablerepo flag was the right approach all along — it only failed because ART_DNF_WRAPPER_POLICY=append was missing. Now that it's set, dnf sees the repo file and the flag works. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
images/Dockerfile (1)
5-6: 💤 Low valueConsider anchoring the sed pattern for robustness.
The current pattern
s/enabled=0/enabled=1/would match any occurrence of that substring. While the repo file currently has a singleenabled=0line, a more anchored pattern prevents accidental substitution if the file format evolves.♻️ Suggested fix
- sed -i 's/enabled=0/enabled=1/' /etc/yum.repos.d/claude-code-latest.repo && \ + sed -i 's/^enabled=0$/enabled=1/' /etc/yum.repos.d/claude-code-latest.repo && \🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@images/Dockerfile` around lines 5 - 6, The sed pattern in the dnf install command is not anchored and could inadvertently match substrings elsewhere in the file if the format evolves. Modify the sed pattern from `s/enabled=0/enabled=1/` to include an anchor such as `s/^enabled=0/enabled=1/` (anchoring to the start of a line) to ensure it only matches the intended configuration line and prevents accidental substitutions in unrelated content.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@images/Dockerfile`:
- Around line 5-6: The sed pattern in the dnf install command is not anchored
and could inadvertently match substrings elsewhere in the file if the format
evolves. Modify the sed pattern from `s/enabled=0/enabled=1/` to include an
anchor such as `s/^enabled=0/enabled=1/` (anchoring to the start of a line) to
ensure it only matches the intended configuration line and prevents accidental
substitutions in unrelated content.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: ca6780f8-b056-4690-b65c-4540cc8e8062
📒 Files selected for processing (2)
README.mdimages/Dockerfile
✅ Files skipped from review due to trivial changes (1)
- README.md
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ggiguash, stbenjam The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
latestRPM channel/usr/local/bin/claude-unstableclaude(with--disablerepo=claude-code-latestto avoid version mixing)images/repos/claude-code-latest.repopointing athttps://downloads.claude.ai/claude-code/rpm/latest, using the same GPG key already committed in the repoCurrently stable is at 2.1.153, latest is at 2.1.177.
Test plan
claude --versionreturns stable versionclaude-unstable --versionreturns latest version🤖 Generated with Claude Code
Summary by CodeRabbit
claude-latest, alongside the existingclaude.claudeandclaude-latest.