-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (30 loc) · 1.18 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
# NOTE: context is expected to be repo root, not controller/ dir
#
# BUILDER
#
FROM docker.io/library/golang:1.22.5 AS builder
WORKDIR /buildroot
# 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.
COPY client/ client/
COPY internal/ internal/
COPY controller/go.mod controller/go.mod
COPY controller/go.sum controller/go.sum
WORKDIR /buildroot/controller
RUN go mod download
COPY controller/cmd/ cmd/
COPY controller/pkg/ pkg/
ENV CGO_ENABLED=0
RUN go build -o artifacts/controller-manager cmd/controller-manager/*.go
#
# FINAL IMAGE
#
FROM gcr.io/distroless/static:latest
LABEL maintainers="Kubernetes Authors"
LABEL description="COSI Controller"
LABEL org.opencontainers.image.title="COSI Controller"
LABEL org.opencontainers.image.description="Container Object Storage Interface (COSI) Controller"
LABEL org.opencontainers.image.source="https://github.com/kubernetes-sigs/container-object-storage-interface-api/controller"
LABEL org.opencontainers.image.licenses="APACHE-2.0"
COPY --from=builder /buildroot/controller/artifacts/controller-manager .
ENTRYPOINT ["/controller-manager"]