-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathDockerfile
43 lines (33 loc) · 985 Bytes
/
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
# Build the manager binary
FROM quay.io/centos/centos:stream9 AS builder
RUN dnf install git golang -y
# Ensure go 1.16
RUN go install golang.org/dl/go1.16@latest
RUN ~/go/bin/go1.16 download
RUN /bin/cp -f ~/go/bin/go1.16 /usr/bin/go
RUN go version
WORKDIR /workspace
COPY go.mod go.mod
COPY go.sum go.sum
COPY main.go main.go
COPY api/ api/
COPY hack/ hack/
COPY controllers/ controllers/
COPY version/ version/
COPY vendor/ vendor/
# for getting version info
COPY .git/ .git/
# for HCO
COPY bundle/ bundle/
# Build
RUN ./hack/build.sh
# Use ubi8 as minimal base image to package the manager binary
FROM registry.access.redhat.com/ubi8/ubi-minimal
WORKDIR /
COPY --from=builder /workspace/bin/manager .
USER 65532:65532
# needed for HCO
LABEL org.kubevirt.hco.csv-generator.v1="/usr/local/bin/csv-generator"
COPY --from=builder /workspace/hack/csv-generator.sh /usr/local/bin/csv-generator
COPY --from=builder /workspace/bundle/manifests /manifests
ENTRYPOINT ["/manager"]