-
Notifications
You must be signed in to change notification settings - Fork 102
/
Copy pathDockerfile.assisted-installer
34 lines (24 loc) · 1.1 KB
/
Dockerfile.assisted-installer
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
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 installer
# Extract the commit reference from which the image is built
RUN git rev-parse --short HEAD > /commit-reference.txt
FROM quay.io/centos/centos:stream9
# required for nsenter
RUN dnf install -y util-linux-core && dnf clean all
COPY --from=builder /go/src/github.com/openshift/assisted-installer/build/installer /usr/bin/installer
COPY --from=builder /go/src/github.com/openshift/assisted-installer/deploy/assisted-installer-controller /assisted-installer-controller/deploy
# Copy the commit reference from the builder
COPY --from=builder /commit-reference.txt /commit-reference.txt
ENTRYPOINT ["/usr/bin/installer"]