forked from opendatahub-io/kueue
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.rhoai
42 lines (30 loc) · 1.02 KB
/
Dockerfile.rhoai
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
# Start of Go versioning workaround for lack of go-toolset for version 1.22
FROM registry-proxy.engineering.redhat.com/rh-osbs/openshift-golang-builder:v1.22.2 AS golang
FROM registry.access.redhat.com/ubi9/ubi:latest AS builder
ARG GOLANG_VERSION=1.22.2
# Install system dependencies
RUN dnf upgrade -y && dnf install -y \
gcc \
make \
openssl-devel \
&& 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
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 . .
# Build
RUN make build GO_BUILD_ENV='CGO_ENABLED=1 GOOS=linux'
FROM registry.access.redhat.com/ubi9/ubi:latest
WORKDIR /
USER root
COPY --from=builder /workspace/bin/manager /manager
USER 65532:65532
ENTRYPOINT ["/manager"]