Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROX-20236: Set release Dockerfile label explicitly #1705

Merged
merged 1 commit into from
Jun 7, 2024
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
13 changes: 10 additions & 3 deletions collector/container/konflux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG BUILD_DIR=/build
ARG CMAKE_BUILD_DIR=${BUILD_DIR}/cmake-build


# Builder
# TODO(ROX-20312): we can't pin image tag or digest because currently there's no mechanism to auto-update that.
# TODO(ROX-20651): use content sets instead of subscription manager for access to RHEL RPMs once available.
Expand Down Expand Up @@ -38,6 +39,7 @@ RUN /tmp/.konflux/scripts/subscription-manager-bro.sh register /mnt && \
/tmp/.konflux/scripts/subscription-manager-bro.sh cleanup && \
dnf -y --installroot=/mnt clean all


FROM scratch as builder

COPY --from=rpm-implanter-builder /mnt /
Expand Down Expand Up @@ -89,9 +91,11 @@ RUN ./builder/install/install-dependencies.sh && \
ctest -V --test-dir ${CMAKE_BUILD_DIR} && \
strip -v --strip-unneeded "${CMAKE_BUILD_DIR}/collector/collector"


# TODO(ROX-20312): we can't pin image tag or digest because currently there's no mechanism to auto-update that.
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest AS ubi-minimal


# Application
FROM ubi-normal AS rpm-implanter-app

Expand All @@ -112,6 +116,7 @@ RUN /tmp/.konflux/scripts/subscription-manager-bro.sh register /mnt && \
rpm --root=/mnt --verbose -e --nodeps $(rpm --root=/mnt -qa 'curl' '*rpm*' '*dnf*' '*libsolv*' '*hawkey*' 'yum*') && \
rm -rf /mnt/var/cache/dnf /mnt/var/cache/yum


FROM scratch

COPY --from=rpm-implanter-app /mnt /
Expand All @@ -127,13 +132,15 @@ LABEL \
io.k8s.description="This image supports runtime data collection for Red Hat Advanced Cluster Security for Kubernetes" \
io.openshift.tags="rhacs,collector,stackrox" \
maintainer="Red Hat, Inc." \
# TODO(ROX-20236): release label is required by EC, figure what to put in the release version on rebuilds.
release="0" \
source-location="https://github.com/stackrox/collector" \
summary="Runtime data collection for Red Hat Advanced Cluster Security for Kubernetes" \
url="https://catalog.redhat.com/software/container-stacks/detail/60eefc88ee05ae7c5b8f041c" \
vendor="Red Hat, Inc." \
# We must set version label for EC and to prevent inheriting value set in the base stage.
version="${COLLECTOR_TAG}" \
vendor="Red Hat, Inc."
# Release label is required by EC although has no practical semantics.
# We also set it to not inherit one from a base stage in case it's RHEL or UBI.
release="1"

ARG BUILD_DIR
ARG CMAKE_BUILD_DIR
Expand Down
Loading