Skip to content

Add claude-latest binary via multi-stage build - #545

Merged
openshift-merge-bot[bot] merged 9 commits into
openshift-eng:mainfrom
stbenjam:claude-unstable-binary
Jun 15, 2026
Merged

openshift-merge-bot[bot] merged 9 commits into
openshift-eng:mainfrom
stbenjam:claude-unstable-binary

Conversation

@stbenjam

@stbenjam stbenjam commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a builder stage to the Dockerfile that installs Claude Code from the latest RPM channel
  • Copies the binary into the final image as /usr/local/bin/claude-unstable
  • The main stage continues to install the stable version as claude (with --disablerepo=claude-code-latest to avoid version mixing)
  • Adds images/repos/claude-code-latest.repo pointing at https://downloads.claude.ai/claude-code/rpm/latest, using the same GPG key already committed in the repo

Currently stable is at 2.1.153, latest is at 2.1.177.

Test plan

  • Verify container image builds successfully with multi-stage build
  • Verify claude --version returns stable version
  • Verify claude-unstable --version returns latest version
  • Verify both binaries are functional standalone

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Updated the Docker container to include an additional Claude Code binary, claude-latest, alongside the existing claude.
  • Documentation
    • Amended the “Using the Docker Container” section to clarify that the image provides both claude and claude-latest.
  • Chores
    • Added support for installing the latest/unstable RPM feed with GPG and repository metadata verification.

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>
@openshift-ci
openshift-ci Bot requested review from bentito and bryan-cox June 15, 2026 10:40
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 15, 2026
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9458ce4a-6d23-4fa0-8f5e-3b546277da32

📥 Commits

Reviewing files that changed from the base of the PR and between 2a05c3a and 7a74a8f.

📒 Files selected for processing (1)
  • images/Dockerfile
🚧 Files skipped from review as they are similar to previous changes (1)
  • images/Dockerfile

Walkthrough

The Dockerfile is converted to a multi-stage build. A new claude-latest stage installs claude-code via a new DNF repo config (images/repos/claude-code-latest.repo) with GPG verification. The resulting binary is then copied into /usr/local/bin/claude-latest in the final image, while the claude-code-latest repo is disabled during the final image's system package installation. Documentation is updated to describe both available binaries.

Changes

Claude Code Latest Installation via Multi-Stage Build

Layer / File(s) Summary
DNF repository configuration for claude-code-latest
images/repos/claude-code-latest.repo
New repo file defining the claude-code-latest RPM repository URL, disabled enabled state, and GPG key verification path using file:///etc/pki/rpm-gpg/RPM-GPG-KEY-claude-code.
Multi-stage Dockerfile build and binary installation
images/Dockerfile
Adds a new claude-latest build stage that copies the repo config and GPG key, enables the repository, installs claude-code via dnf, and cleans dnf metadata. The final stage copies /usr/bin/claude from the build stage into /usr/local/bin/claude-latest.
Documentation of available Claude Code binaries
README.md
Documents that the container provides two Claude Code executables: claude (stable RPM channel) and claude-latest (latest RPM channel).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • mrunalp
  • brandisher
🚥 Pre-merge checks | ✅ 10
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add claude-latest binary via multi-stage build' accurately describes the main change: adding a new claude-latest binary through a multi-stage Docker build approach.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No Real People Names In Style References ✅ Passed PR contains no references to real people by name in style references, plugin commands, skill documentation, or example prompts. Changes are purely infrastructure (Dockerfile, repository config) and...
No Assumed Git Remote Names ✅ Passed PR changes (Dockerfile, repo config, Docker section of README) contain no hardcoded git remote names; pre-existing git clone in README is unmodified.
Git Push Safety Rules ✅ Passed The PR contains only Docker, configuration, and documentation changes with no git push commands, force push operations, or autonomous push mechanisms invoked or modified.
No Untrusted Mcp Servers ✅ Passed The PR introduces no MCP server installations. Changes are limited to Docker image configuration: a multi-stage build for Claude Code RPM installation, a YUM/DNF repository config, and README docum...
Ai-Helpers Overlap Detection ✅ Passed PR modifies only Dockerfile, repository config, and README.md—no ai-helpers files (plugins//commands/.md, plugins//skills//SKILL.md, agents/*.md). Per Phase 1, check is skipped for PRs modifyin...

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@stbenjam stbenjam changed the title Add claude-unstable binary via multi-stage build Add claude-latest binary via multi-stage build Jun 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5aa5022 and fb24c61.

📒 Files selected for processing (2)
  • images/Dockerfile
  • images/repos/claude-code-latest.repo

Comment thread images/repos/claude-code-latest.repo Outdated
stbenjam and others added 7 commits June 15, 2026 06:48
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>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
images/Dockerfile (1)

5-6: 💤 Low value

Consider 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 single enabled=0 line, 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

📥 Commits

Reviewing files that changed from the base of the PR and between 00ccfc1 and 2a05c3a.

📒 Files selected for processing (2)
  • README.md
  • images/Dockerfile
✅ Files skipped from review due to trivial changes (1)
  • README.md

@ggiguash

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 15, 2026
@openshift-ci

openshift-ci Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit b50e79f into openshift-eng:main Jun 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants