forked from red-hat-data-services/odh-model-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.konflux
44 lines (33 loc) · 1.42 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
# Build arguments
ARG SOURCE_CODE=.
# Build the manager binary
FROM registry.redhat.io/ubi8/go-toolset:1.21@sha256:742ae6ec1aef3e7faae488c47695fb64964d342aefecf52d23bd9d5e6731d0b6 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/
# Build
USER root
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
FROM registry.redhat.io/ubi8/ubi-minimal@sha256:c12e67af6a7e15113d76bc72f10bef2045c026c71ec8b7124c8a075458188a83 AS runtime
ARG USER=2000
LABEL com.redhat.component="odh-model-controller-container" \
name="managed-open-data-hub/odh-model-controller-rhel8" \
description="The controller removes the need for users to perform manual steps when deploying their models" \
summary="odh-model-controller" \
maintainer="['managed-open-data-hub@redhat.com']" \
io.openshift.expose-services="" \
io.k8s.display-name="odh-model-controller" \
io.k8s.description="odh-model-controller" \
com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf"
WORKDIR /
COPY --from=builder /workspace/manager .
USER ${USER}
ENTRYPOINT ["/manager"]