NO-JIRA: Dockerfile.art: package oc-mirror binaries as tar.gz archives#1475
NO-JIRA: Dockerfile.art: package oc-mirror binaries as tar.gz archives#1475aguidirh wants to merge 1 commit into
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@aguidirh: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughThe final CLI image build now creates a ChangesCLI release artifacts
Estimated code review effort: 1 (Trivial) | ~2 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aguidirh 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 |
|
/hold Until we get confirmation from konflux |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/cli/Dockerfile.art`:
- Around line 46-48: Add an appropriate non-root USER directive in the final
image stage after the archive-generation RUN commands and before ENTRYPOINT.
Ensure the resulting image, including its release artifacts, runs as a non-root
user and never defaults to root.
- Around line 46-48: Update the release packaging commands in the Dockerfile so
the archive architecture suffix matches the binaries produced by the build:
either invoke the amd64-pinned build target before creating the archives or
derive the names from the actual build platform. Ensure both oc-mirror release
tarballs cannot be labeled amd64 when the build output uses another
architecture.
🪄 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: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: efdae02e-45b7-4328-b07a-7053df3daade
📒 Files selected for processing (1)
images/cli/Dockerfile.art
| RUN mkdir -p /releases/ | ||
| RUN tar czf /releases/oc-mirror-rhel9-linux-amd64.tar.gz -C /usr/bin oc-mirror | ||
| RUN tar czf /releases/oc-mirror-rhel8-linux-amd64.tar.gz -C /usr/bin oc-mirror.rhel8 |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Run the final image as a non-root user.
The final stage has no USER directive, so the image—including the new release artifacts—runs as root by default. Add an appropriate non-root USER after the archive-generation steps and before ENTRYPOINT.
As per path instructions: “USER non-root; never run as root.”
🤖 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/cli/Dockerfile.art` around lines 46 - 48, Add an appropriate non-root
USER directive in the final image stage after the archive-generation RUN
commands and before ENTRYPOINT. Ensure the resulting image, including its
release artifacts, runs as a non-root user and never defaults to root.
Source: Path instructions
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
git ls-files images/cli/Dockerfile.art
printf '\n---\n'
cat -n images/cli/Dockerfile.art | sed -n '1,140p'Repository: openshift/oc-mirror
Length of output: 3644
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n "Dockerfile\.art|oc-mirror-rhel9-linux-amd64|oc-mirror-rhel8-linux-amd64|linux-amd64" .github . -g '!**/vendor/**' -g '!**/bin/**'Repository: openshift/oc-mirror
Length of output: 964
🏁 Script executed:
#!/bin/bash
set -euo pipefail
ast-grep outline Makefile --view expanded
printf '\n---\n'
sed -n '1,180p' Makefile | cat -n
printf '\n=== workflows ===\n'
rg -n "images/cli/Dockerfile\.art|oc-mirror-rhel9-linux-amd64|oc-mirror-rhel8-linux-amd64|cross-build-linux-amd64|GOARCH=amd64|platform" .githubRepository: openshift/oc-mirror
Length of output: 4912
🏁 Script executed:
#!/bin/bash
set -euo pipefail
git ls-files | rg '(^|/)(.*images.*|.*image.*|.*\.yaml$|.*\.yml$)'
printf '\n=== Dockerfile.art refs ===\n'
rg -n "Dockerfile\.art|oc-mirror-rhel9-linux-amd64|oc-mirror-rhel8-linux-amd64|cross-build-linux-amd64|platforms?|arch|amd64" . \
-g '!**/vendor/**' -g '!**/bin/**' -g '!**/dist/**'Repository: openshift/oc-mirror
Length of output: 50376
🏁 Script executed:
#!/bin/bash
set -euo pipefail
git ls-files images/cli
printf '\n---\n'
rg -n "Dockerfile\.art|cross-build-linux-amd64|linux-amd64|oc-mirror-rhel9-linux-amd64|oc-mirror-rhel8-linux-amd64" images/cli .github Makefile --max-count 20Repository: openshift/oc-mirror
Length of output: 815
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n "images/cli/Dockerfile\.art|Dockerfile\.art|oc-mirror-rhel9-linux-amd64|oc-mirror-rhel8-linux-amd64" .github images Makefile --glob '*.yml' --glob '*.yaml' --glob 'Dockerfile*' --max-count 50Repository: openshift/oc-mirror
Length of output: 379
Align the release archive names with the build arch.
In images/cli/Dockerfile.art:46-48, make build doesn’t pin GOARCH, so these tarballs can be mislabeled if the image is built on anything other than amd64. Either use the amd64 cross-build target here or derive the suffix from the build platform.
🤖 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/cli/Dockerfile.art` around lines 46 - 48, Update the release packaging
commands in the Dockerfile so the archive architecture suffix matches the
binaries produced by the build: either invoke the amd64-pinned build target
before creating the archives or derive the names from the actual build platform.
Ensure both oc-mirror release tarballs cannot be labeled amd64 when the build
output uses another architecture.
|
@aguidirh: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/lgtm |
|
Pipeline controller notification No second-stage tests were triggered for this PR. This can happen when:
Use |
Summary
/releases/directory in the ART Dockerfileoc-mirrorbinary asoc-mirror-rhel9-linux-amd64.tar.gzoc-mirror.rhel8binary asoc-mirror-rhel8-linux-amd64.tar.gzTest plan
RUNsteps/releases/directory contains the expected tar archives after buildSummary by CodeRabbit
oc-mirrortool.