forked from opendatahub-io/data-science-pipelines-operator
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathDockerfile.konflux
More file actions
51 lines (39 loc) · 1.88 KB
/
Dockerfile.konflux
File metadata and controls
51 lines (39 loc) · 1.88 KB
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
# Build arguments
ARG SOURCE_CODE=.
FROM registry.access.redhat.com/ubi9/go-toolset:1.24@sha256:6234f572204d672a0ee0686d748fbb9b7b05679368bf0d7a4446e13970e58060 as builder
ARG SOURCE_CODE
ARG TARGETOS
ARG TARGETARCH
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 config/internal config/internal
USER root
# Build
RUN CGO_ENABLED=1 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} GO111MODULE=on GOEXPERIMENT=strictfipsruntime go build -tags strictfipsruntime -a -o manager main.go
FROM registry.access.redhat.com/ubi9/ubi-minimal@sha256:f225a0f8eb7d258011e1f7c8b025dc7dd155d6ffc66c17cd203dcec88935b455 AS runtime
## Build args to be used at this step
ARG USER=65532
LABEL com.redhat.component="odh-data-science-pipelines-operator-controller-container" \
name="managed-open-data-hub/odh-data-science-pipelines-operator-controller-rhel8" \
description="Manages lifecycle of Data Science Pipelines Custom Resources and associated Kubernetes resources" \
summary="odh-data-science-pipelines-operator-controller" \
maintainer="['managed-open-data-hub@redhat.com']" \
io.openshift.expose-services="" \
io.k8s.display-name="data-science-pipelines-operator-controller" \
io.k8s.description="data-science-pipelines-operator-controller" \
com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf"
WORKDIR /
COPY --from=builder /workspace/manager .
COPY --from=builder /workspace/config/internal ./config/internal
## Create a non-root user with UID 65532 and switch to it
USER ${USER}:${USER}
ENTRYPOINT ["/manager"]