-
Notifications
You must be signed in to change notification settings - Fork 61
/
Dockerfile.base
39 lines (27 loc) · 1014 Bytes
/
Dockerfile.base
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
# Build the manager binary
FROM registry.access.redhat.com/ubi8/go-toolset:1.21.13-1.1727869850 as builder
USER 0
RUN dnf install -y openssh-clients git make which jq python3
COPY ci/minikube_e2e_tests_inner.sh .
RUN chmod 775 minikube_e2e_tests_inner.sh
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
RUN GO111MODULE=on go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.8.0 \
&& GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/v4@v4.5.2
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
COPY Makefile Makefile
RUN make controller-gen kustomize
COPY hack/boilerplate.go.txt hack/boilerplate.go.txt
COPY main.go main.go
COPY config/ config/
COPY apis/ apis/
COPY controllers/ controllers/
RUN make manifests generate fmt vet release
RUN rm main.go
RUN rm -rf config
RUN rm -rf apis
RUN rm -rf controllers