Skip to content
Merged
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
6 changes: 5 additions & 1 deletion .tekton/scanner-v4-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ spec:
- name: hermetic
value: "true"
- name: prefetch-input
value: '{"type": "gomod", "path": "."}'
value: |
[
{ "type": "gomod", "path": "." },
{ "type": "rpm" }
]
- name: build-source-image
value: 'true'
- name: clone-depth
Expand Down
2 changes: 2 additions & 0 deletions .tekton/scanner-v4-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ spec:
value: $(params.output-image-repo):konflux-$(params.revision).prefetch
- name: ociArtifactExpiresAfter
value: $(params.oci-artifact-expires-after)
- name: ACTIVATION_KEY
value: subscription-manager-activation-key-prod
taskRef:
params:
- name: name
Expand Down
2 changes: 1 addition & 1 deletion rpms.in.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ packages:
- postgresql
# builder stage in operator/konflux.bundle.Dockerfile
- python3.12-pyyaml
# package_installer stage in operator/konflux.Dockerfile and image/roxctl/konflux.Dockerfile
# package_installer stage in operator/konflux.Dockerfile, image/roxctl/konflux.Dockerfile, and scanner/image/scanner/konflux.Dockerfile
- ca-certificates
- openssl
moduleEnable:
Expand Down
35 changes: 20 additions & 15 deletions scanner/image/scanner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
ARG MAPPINGS_REGISTRY=registry.access.redhat.com
ARG MAPPINGS_BASE_IMAGE=ubi9
ARG MAPPINGS_BASE_TAG=latest
ARG BASE_REGISTRY=registry.access.redhat.com
ARG BASE_IMAGE=ubi9-minimal
ARG BASE_TAG=latest

FROM ${MAPPINGS_REGISTRY}/${MAPPINGS_BASE_IMAGE}:${MAPPINGS_BASE_TAG} AS mappings
FROM registry.access.redhat.com/ubi9/ubi:latest AS mappings

COPY download-mappings.sh /download-mappings.sh
RUN /download-mappings.sh /mappings

# Build Delve debugger when DEBUG_BUILD=yes.
FROM ${MAPPINGS_REGISTRY}/${MAPPINGS_BASE_IMAGE}:${MAPPINGS_BASE_TAG} AS debugger
FROM registry.access.redhat.com/ubi9/ubi:latest AS debugger

ARG DEBUG_BUILD=no

COPY download-dlv.sh /download-dlv.sh
RUN DEBUG_BUILD=${DEBUG_BUILD} /download-dlv.sh

FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}
FROM registry.access.redhat.com/ubi9/ubi-micro:latest AS ubi-micro-base

FROM registry.access.redhat.com/ubi9/ubi:latest AS package_installer

COPY --from=ubi-micro-base / /out/

RUN dnf install -y \
--installroot=/out/ \
--releasever=9 \
--setopt=install_weak_deps=0 \
--nodocs \
ca-certificates && \
dnf clean all --installroot=/out/ && \
rm -rf /out/var/cache/dnf /out/var/cache/yum

FROM ubi-micro-base

ARG LABEL_VERSION
ARG LABEL_RELEASE
Expand All @@ -35,6 +43,7 @@ LABEL name="scanner-v4" \

SHELL ["/bin/sh", "-o", "pipefail", "-c"]

COPY --from=package_installer /out/ /
COPY scripts/entrypoint.sh \
scripts/import-additional-cas \
scripts/restore-all-dir-contents \
Expand All @@ -45,11 +54,7 @@ COPY --from=mappings /mappings/repository-to-cpe.json /mappings/container-name-r
# Copy Delve debugger if built (empty dir when DEBUG_BUILD=no).
COPY --from=debugger /output/go/ /go/

RUN microdnf upgrade -y --nobest && \
microdnf clean all && \
# (Optional) Remove line below to keep package management utilities
rpm -e --nodeps $(rpm -qa curl '*rpm*' '*dnf*' '*libsolv*' '*hawkey*' 'yum*') && \
rm -rf /var/cache/dnf /var/cache/yum && \
RUN \
chown -R 65534:65534 /tmp && \
# The contents of paths mounted as emptyDir volumes in Kubernetes are saved
# by the script `save-dir-contents` during the image build. The directory
Expand Down
24 changes: 19 additions & 5 deletions scanner/image/scanner/konflux.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,23 @@ WORKDIR /src

RUN make -C scanner NODEPS=1 CGO_ENABLED=1 image/scanner/bin/scanner copy-scripts

FROM registry.access.redhat.com/ubi9/ubi-micro:latest@sha256:093a704be0eaef9bb52d9bc0219c67ee9db13c2e797da400ddb5d5ae6849fa10 AS ubi-micro-base

FROM registry.access.redhat.com/ubi9/ubi-minimal:latest@sha256:69f5c9886ecb19b23e88275a5cd904c47dd982dfa370fbbd0c356d7b1047ef68
FROM registry.access.redhat.com/ubi9/ubi:latest@sha256:6ed9f6f637fe731d93ec60c065dbced79273f1e0b5f512951f2c0b0baedb16ad AS package_installer

COPY --from=ubi-micro-base / /out/

RUN dnf install -y \
--installroot=/out/ \
--releasever=9 \
--setopt=install_weak_deps=0 \
--setopt=reposdir=/etc/yum.repos.d \
--nodocs \
ca-certificates openssl && \
dnf clean all --installroot=/out/ && \
rm -rf /out/var/cache/dnf /out/var/cache/yum

FROM ubi-micro-base

ARG BUILD_TAG

Expand All @@ -40,6 +55,8 @@ LABEL \
# We also set it to not inherit one from a base stage in case it's RHEL or UBI.
release="1"

COPY --from=package_installer /out/ /

COPY --from=builder \
/src/scanner/image/scanner/scripts/entrypoint.sh \
/src/scanner/image/scanner/scripts/import-additional-cas \
Expand All @@ -55,10 +72,7 @@ COPY --from=builder \

COPY .konflux/scanner-data/repository-to-cpe.json .konflux/scanner-data/container-name-repos-map.json /run/mappings/

RUN microdnf clean all && \
# (Optional) Remove line below to keep package management utilities
rpm -e --nodeps $(rpm -qa curl '*rpm*' '*dnf*' '*libsolv*' '*hawkey*' 'yum*') && \
rm -rf /var/cache/dnf /var/cache/yum && \
RUN \
chown -R 65534:65534 /tmp && \
# The contents of paths mounted as emptyDir volumes in Kubernetes are saved
# by the script `save-dir-contents` during the image build. The directory
Expand Down
Loading