-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
53 lines (39 loc) · 1.57 KB
/
Dockerfile
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
# Build the siteconfig-manager binary
FROM registry.redhat.io/ubi9/go-toolset:1.22.9 AS builder
ARG TARGETOS
ARG TARGETARCH
WORKDIR /opt/app-root/src
# Bring in the go dependencies before anything else so we can take
# advantage of caching these layers in future builds.
COPY vendor/ vendor/
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# Copy the go source
COPY cmd/ cmd/
COPY api/ api/
COPY internal/ internal/
# Build the binaries
RUN CGO_ENABLED=1 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} GO111MODULE=on \
go build -mod=vendor -a -o build/siteconfig-manager cmd/main.go
#####################################################################################################
# Build the controller image
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5
ENV SUMMARY="SiteConfig Operator is a template-driven cluster provisioning solution" \
DESCRIPTION="SiteConfig operator as a template-driven cluster provisioning solution, which allows you to \
provision clusters with all available installation methods."
LABEL name="siteconfig" \
summary="${SUMMARY}" \
description="${DESCRIPTION}" \
com.redhat.component="siteconfig-operator" \
io.k8s.display-name="SiteConfig Operator" \
io.k8s.description="${DESCRIPTION}" \
io.openshift.tags="siteconfig,template-driven,cluster,provisioning,lifecycle"
COPY --from=builder \
/opt/app-root/src/build/siteconfig-manager \
/usr/local/bin/
# Copy the licence
COPY LICENSE /licenses/LICENSE
ENV USER_UID=65532
USER ${USER_UID}
ENTRYPOINT ["/usr/local/bin/siteconfig-manager"]