-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use entitled Dockerfile for Konflux (#193)
Signed-off-by: zlayne <zlayne@redhat.com>
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# 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 /workspace | ||
# Copy the Go Modules manifests | ||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
# cache deps before building and copying source so that we don't need to re-download as much | ||
# and so that source changes don't invalidate our downloaded layer | ||
RUN go mod download | ||
|
||
# Copy the go source | ||
COPY main.go main.go | ||
COPY api/ api/ | ||
COPY controllers/ controllers/ | ||
COPY addon/ addon/ | ||
|
||
# Build | ||
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -o manager 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" | ||
|
||
ENV USER_UID=1001 \ | ||
USER_NAME=search-v2-operator | ||
|
||
RUN microdnf update -y && microdnf clean all | ||
|
||
|
||
# install operator binary | ||
COPY --from=builder /workspace/manager . | ||
USER ${USER_UID} | ||
|
||
ENTRYPOINT ["/manager"] | ||
|