forked from openshift/assisted-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.assisted-installer-controller
29 lines (22 loc) · 1.08 KB
/
Dockerfile.assisted-installer-controller
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
FROM registry.access.redhat.com/ubi9/go-toolset:1.21 AS builder
ARG TARGETPLATFORM
ENV GOFLAGS=-mod=mod
WORKDIR /go/src/github.com/openshift/assisted-installer
# Workaround for creating build folder
USER root
# Bring in the go dependencies before anything else so we can take
# advantage of caching these layers in future builds.
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
COPY . .
RUN git config --global --add safe.directory '*'; \
TARGETPLATFORM=$TARGETPLATFORM make controller
FROM quay.io/centos/centos:stream9
ARG TARGETPLATFORM
# openshift clients
RUN case $TARGETPLATFORM in "") platform=amd64;; *) platform=`echo $TARGETPLATFORM | sed 's#linux/##'` ;; esac ; \
curl -k -L -s "https://mirror.openshift.com/pub/openshift-v4/multi/clients/ocp/latest/amd64/openshift-client-linux-${platform}-rhel9.tar.gz" | tar xvz -C /usr/bin; \
chmod +x /usr/bin/oc /usr/bin/kubectl
COPY --from=builder /go/src/github.com/openshift/assisted-installer/build/assisted-installer-controller /usr/bin/assisted-installer-controller
ENTRYPOINT ["/usr/bin/assisted-installer-controller"]