forked from opendatahub-io/modelmesh-serving
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile.konflux
62 lines (47 loc) · 1.92 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
#go-toolset:1.21
FROM registry.redhat.io/ubi9/go-toolset:1.21@sha256:d73c4151518c73332717a52f5d22c670bf2f88e04a841e507aef0227b3100225 AS build
ARG TARGETOS=linux
ARG TARGETARCH=amd64
LABEL image="build"
# Copy the go sources
COPY main.go main.go
COPY apis/ apis/
COPY controllers/ controllers/
COPY generated/ generated/
COPY pkg/ pkg/
COPY version /etc/modelmesh-version
USER root
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
# Build using native go compiler from BUILDPLATFORM but compiled output for TARGETPLATFORM
RUN GOOS=${TARGETOS:-linux} \
GOARCH=${TARGETARCH:-amd64} \
CGO_ENABLED=0 \
GO111MODULE=on \
go build -a -o /workspace/manager main.go
###############################################################################
# Stage 2: Copy build assets to create the smallest final runtime image
###############################################################################
#ubi-minimal:latest
FROM registry.redhat.io/ubi8/ubi-minimal@sha256:cf095e5668919ba1b4ace3888107684ad9d587b1830d3eb56973e6a54f456e67 AS runtime
ARG USER=2000
ARG IMAGE_VERSION
ARG COMMIT_SHA
LABEL com.redhat.component="odh-modelmesh-serving-controller-container" \
name="managed-open-data-hub/odh-modelmesh-serving-controller-rhel8" \
description="Manages lifecycle of ModelMesh Serving Custom Resources and associated Kubernetes resources" \
summary="odh-modelmesh-serving-controller" \
maintainer="['[email protected]']" \
io.openshift.expose-services="" \
io.k8s.display-name="modelmesh-serving-controller" \
io.k8s.description="modelmesh-serving-controller" \
com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf"
## Install additional packages
RUN microdnf install -y shadow-utils &&\
microdnf clean all
USER ${USER}
WORKDIR /
COPY --from=build /workspace/manager .
COPY config/internal config/internal
ENTRYPOINT ["/manager"]