-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDockerfile.bootstrap-provider
More file actions
55 lines (45 loc) · 2.19 KB
/
Dockerfile.bootstrap-provider
File metadata and controls
55 lines (45 loc) · 2.19 KB
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
# Build the manager binary
FROM registry.access.redhat.com/ubi9/go-toolset:1.25 AS builder
ARG TARGETOS
ARG TARGETARCH
WORKDIR /opt/app-root/src
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
COPY vendor vendor
# Copy the go source
COPY bootstrap/main.go bootstrap/main.go
COPY bootstrap/api/ bootstrap/api/
COPY controlplane/api/ controlplane/api/
COPY util util
COPY pkg pkg
COPY assistedinstaller assistedinstaller
COPY bootstrap/internal/ bootstrap/internal/
# Build
# the GOARCH has not a default value to allow the binary be built according to the host where the command
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
RUN CGO_ENABLED=1 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} go build -mod=vendor -a -o manager bootstrap/main.go
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest@sha256:6fc28bcb6776e387d7a35a2056d9d2b985dc4e26031e98a2bd35a7137cd6fd71
ARG release=main
ARG version=latest
WORKDIR /
COPY --from=builder /opt/app-root/src/manager .
USER 65532:65532
ENV SUMMARY="Cluster API Bootstrap Provider OpenShift Assisted is a CAPI bootstrap provider for provisioning OpenShift clusters" \
DESCRIPTION="Cluster API Bootstrap Provider OpenShift Assisted orchestrates cluster provisioning leveraging Assisted Installer"
LABEL name="multicluster-engine/capoa-bootstrap-rhel9" \
cpe="cpe:/a:redhat:multicluster_engine:2.17::el9" \
summary="${SUMMARY}" \
description="${DESCRIPTION}" \
com.redhat.component="cluster-api-bootstrap-provider-openshift-assisted" \
io.k8s.display-name="CAPI Bootstrap Provider OpenShift Assisted" \
io.k8s.description="${DESCRIPTION}" \
io.openshift.tags="capi,install,cluster,provisioning,bootstrap" \
distribution-scope="public" \
release="${release}" \
version="${version}" \
url="https://github.com/openshift-assisted/cluster-api-provider-openshift-assisted" \
vendor="Red Hat, Inc."
ENTRYPOINT ["/manager"]