forked from opendatahub-io/codeflare-operator
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile.konflux
62 lines (47 loc) · 2.03 KB
/
Dockerfile.konflux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Build arguments
ARG SOURCE_CODE=.
# BEGIN -- workaround lack of go-toolset for golang 1.23
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_golang_1.23@sha256:0a070e4a8f2698b6aba3630a49eb995ff1b0a182d0c5fa264888acf9d535f384 AS golang
FROM registry.access.redhat.com/ubi8/ubi@sha256:f2fc79fc75667bcdef182127a340ff71d852d7f72ebdf1d25959a85dd784fae5 AS builder
ARG GOLANG_VERSION=1.23.0
# Install system dependencies
RUN dnf upgrade -y && dnf install -y \
gcc \
make \
openssl-devel \
git \
&& dnf clean all && rm -rf /var/cache/yum
# Install Go
ENV PATH=/usr/local/go/bin:$PATH
COPY --from=golang /usr/lib/golang /usr/local/go
# End of Go versioning workaround
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 . .
# Copy the Go sources
COPY main.go main.go
COPY pkg/ pkg/
RUN git config --global --add safe.directory /workspace
# Build
USER root
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -tags strictfipsruntime -a -o manager main.go
FROM registry.access.redhat.com/ubi8/ubi-minimal@sha256:33161cf5ec11ea13bfe60cad64f56a3aa4d893852e8ec44b2fd2a6b40cc38539
WORKDIR /
COPY --from=builder /workspace/manager .
USER 65532:65532
ENTRYPOINT ["/manager"]
LABEL com.redhat.component="odh-codeflare-operator-container" \
description="Manages lifecycle of MCAD and InstaScale custom resources and associated Kubernetes resources" \
name="managed-open-data-hub/odh-codeflare-operator-container-rhel8" \
summary="odh-codeflare-operator-container" \
maintainer="['[email protected]']" \
io.openshift.expose-services="" \
io.k8s.display-name="odh-codeflare-operator-container" \
io.k8s.description="odh-codeflare-operator" \
com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf"