Skip to content
Merged
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
6 changes: 5 additions & 1 deletion make.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ ARG GOLANGCI_LINT_VERSION

FROM registry.access.redhat.com/ubi8/ubi

ARG GOLANGCI_LINT_VERSION

RUN yum install -y ca-certificates git go-toolset make

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win

Clean yum metadata after installation.

Add yum clean all (and remove the remaining cache) in the same layer to avoid unnecessarily inflating the containerized lint/test image.

Proposed fix
-RUN yum install -y ca-certificates git go-toolset make
+RUN yum install -y ca-certificates git go-toolset make \
+    && yum clean all \
+    && rm -rf /var/cache/yum
📝 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
RUN yum install -y ca-certificates git go-toolset make
RUN yum install -y ca-certificates git go-toolset make \
&& yum clean all \
&& rm -rf /var/cache/yum
🧰 Tools
🪛 Trivy (0.69.3)

[error] 7-7: 'yum clean all' missing

'yum clean all' is missed: yum install -y ca-certificates git go-toolset make

Rule: DS-0015

Learn more

(IaC/Dockerfile)

🤖 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 `@make.Dockerfile` at line 7, Update the yum installation RUN command to clean
yum metadata and remove remaining package-manager caches in the same image layer
after installing ca-certificates, git, go-toolset, and make. Keep the existing
package installation behavior unchanged while ensuring no yum cache remains in
the resulting image.

Source: Linters/SAST tools


ENV GOPATH=/go
ENV PATH="$GOPATH/bin:${PATH}"
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${GOPATH}/bin ${GOLANGCI_LINT_VERSION}
# Official install URL; the abandoned master-branch script fails checksum verification.
# https://golangci-lint.run/docs/welcome/install/local/#binaries
RUN curl -sSfL https://golangci-lint.run/install.sh | sh -s -- -b ${GOPATH}/bin ${GOLANGCI_LINT_VERSION}

ADD https://password.corp.redhat.com/RH-IT-Root-CA.crt /etc/pki/ca-trust/source/anchors/
RUN update-ca-trust extract