From 853d5ef6930436469f1a2fabaf18369d18505214 Mon Sep 17 00:00:00 2001 From: Zack Layne Date: Tue, 4 Jun 2024 16:07:10 -0400 Subject: [PATCH] Use entitled Dockerfile for Konflux (#278) * Use entitled Dockerfile for Konflux Signed-off-by: zlayne * Update entitled Dockerfile Signed-off-by: zlayne --------- Signed-off-by: zlayne --- Dockerfile.rhtap | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Dockerfile.rhtap diff --git a/Dockerfile.rhtap b/Dockerfile.rhtap new file mode 100644 index 00000000..cf3abc88 --- /dev/null +++ b/Dockerfile.rhtap @@ -0,0 +1,55 @@ +# Copyright Contributors to the Open Cluster Management project + +FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.21 AS builder + +WORKDIR /go/src/github.com/stolostron/search-collector +COPY . . +RUN go mod vendor +RUN CGO_ENABLED=1 GOGC=25 go build -trimpath -o main main.go + +FROM registry.access.redhat.com/ubi9/ubi-minimal:latest + +ARG VCS_REF +ARG VCS_URL +ARG IMAGE_NAME +ARG IMAGE_DESCRIPTION +ARG IMAGE_DISPLAY_NAME +ARG IMAGE_NAME_ARCH +ARG IMAGE_MAINTAINER +ARG IMAGE_VENDOR +ARG IMAGE_VERSION +ARG IMAGE_RELEASE +ARG IMAGE_SUMMARY +ARG IMAGE_OPENSHIFT_TAGS + +LABEL org.label-schema.vendor="Red Hat" \ + org.label-schema.name="$IMAGE_NAME_ARCH" \ + org.label-schema.description="$IMAGE_DESCRIPTION" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url=$VCS_URL \ + org.label-schema.license="Red Hat Advanced Cluster Management for Kubernetes EULA" \ + org.label-schema.schema-version="1.0" \ + name="$IMAGE_NAME" \ + maintainer="$IMAGE_MAINTAINER" \ + vendor="$IMAGE_VENDOR" \ + version="$IMAGE_VERSION" \ + release="$IMAGE_RELEASE" \ + description="$IMAGE_DESCRIPTION" \ + summary="$IMAGE_SUMMARY" \ + io.k8s.display-name="$IMAGE_DISPLAY_NAME" \ + io.k8s.description="$IMAGE_DESCRIPTION" \ + io.openshift.tags="$IMAGE_OPENSHIFT_TAGS" + +RUN microdnf update -y &&\ + microdnf install -y ca-certificates vi --nodocs &&\ + mkdir /licenses &&\ + microdnf clean all + +COPY --from=builder /go/src/github.com/stolostron/search-collector/main /bin/main + +ENV VCS_REF="$VCS_REF" \ + USER_UID=1001 \ + GOGC=25 + +USER ${USER_UID} +ENTRYPOINT ["/bin/main"] \ No newline at end of file