Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build_root_image:
name: release
namespace: openshift
tag: rhel-9-release-golang-1.25-openshift-4.22
tag: rhel-9-release-golang-1.26-openshift-5.0
4 changes: 2 additions & 2 deletions Dockerfile.ocp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS builder

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use approved catalog.redhat.com base images for both stages.

Both FROM lines currently use registry.ci.openshift.org, which violates the container base-image policy for Dockerfiles.

As per coding guidelines, "Base image: UBI minimal or distroless from catalog.redhat.com."

Also applies to: 6-6

🤖 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 `@Dockerfile.ocp` at line 1, The Dockerfile uses registry.ci.openshift.org
images; update both FROM lines (including the first stage image referenced as
"builder") to use the approved catalog.redhat.com UBI minimal or distroless base
images per policy (replace registry.ci.openshift.org/... with the appropriate
catalog.redhat.com UBI/distroless equivalents), ensuring both build and final
stages reference catalog.redhat.com images.

Source: Coding guidelines

WORKDIR /go/src/github.com/openshift/image-registry
COPY . .

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid COPY . .; copy only required build inputs.

COPY . . can unintentionally pull secrets and unrelated files into the build context. Restrict this to explicit paths used by hack/build-go.sh.

Suggested tightening
-COPY . .
+COPY go.mod go.sum ./
+COPY cmd/ ./cmd/
+COPY pkg/ ./pkg/
+COPY hack/ ./hack/
+COPY vendor/ ./vendor/

As per coding guidelines, "COPY specific files, not entire context" and "No secrets in ENV, ARG, or COPY."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
COPY . .
COPY go.mod go.sum ./
COPY cmd/ ./cmd/
COPY pkg/ ./pkg/
COPY hack/ ./hack/
COPY vendor/ ./vendor/
🤖 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 `@Dockerfile.ocp` at line 3, Replace the unsafe "COPY . ." in Dockerfile.ocp
with explicit COPY instructions for only the build inputs referenced by
hack/build-go.sh: inspect hack/build-go.sh to determine required files (e.g.,
go.mod, go.sum, the cmd/ pkg/ internal/ directories, and any scripts/configs it
invokes) and add one or more COPY lines for those paths instead of the entire
context; also update .dockerignore to exclude secrets/unnecessary files and
ensure no secrets are passed via ENV or ARG in the Dockerfile.

Source: Coding guidelines

RUN hack/build-go.sh

FROM registry.ci.openshift.org/ocp/4.22:base-rhel9
FROM registry.ci.openshift.org/ocp/5.0:base-rhel9
RUN yum install -y rsync && yum clean all && rm -rf /var/cache/yum

# Copy both registry binaries:
Expand Down