Skip to content

Commit 40d8b30

Browse files
[local] Dockerfile
1 parent d5c03db commit 40d8b30

File tree

3 files changed

+33
-9
lines changed

3 files changed

+33
-9
lines changed

cmd/csi-snapshotter/Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
FROM gcr.io/distroless/static:latest
2-
LABEL maintainers="Kubernetes Authors"
1+
ARG BASE_IMAGE
2+
3+
FROM golang:1.20 as builder
4+
WORKDIR /go/src/kubernetes-csi/external-snapshotter
5+
ADD . .
6+
ENV GOFLAGS="-buildvcs=false"
7+
RUN make build
8+
9+
FROM $BASE_IMAGE
10+
LABEL maintainers="Compute"
311
LABEL description="CSI External Snapshotter Sidecar"
412
ARG binary=./bin/csi-snapshotter
513

6-
COPY ${binary} csi-snapshotter
14+
COPY --from=builder /go/src/kubernetes-csi/external-snapshotter/${binary} csi-snapshotter
715
ENTRYPOINT ["/csi-snapshotter"]

cmd/snapshot-controller/Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
FROM gcr.io/distroless/static:latest
2-
LABEL maintainers="Kubernetes Authors"
1+
ARG BASE_IMAGE
2+
3+
FROM golang:1.20 as builder
4+
WORKDIR /go/src/kubernetes-csi/external-snapshotter
5+
ADD . .
6+
ENV GOFLAGS="-buildvcs=false"
7+
RUN make build
8+
9+
FROM $BASE_IMAGE
10+
LABEL maintainers="Compute"
311
LABEL description="Snapshot Controller"
412
ARG binary=./bin/snapshot-controller
513

6-
COPY ${binary} snapshot-controller
14+
COPY --from=builder /go/src/kubernetes-csi/external-snapshotter/${binary} snapshot-controller
715
ENTRYPOINT ["/snapshot-controller"]
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
FROM gcr.io/distroless/static:latest
2-
LABEL maintainers="Kubernetes Authors"
1+
ARG BASE_IMAGE
2+
3+
FROM golang:1.20 as builder
4+
WORKDIR /go/src/kubernetes-csi/external-snapshotter
5+
ADD . .
6+
ENV GOFLAGS="-buildvcs=false"
7+
RUN make build
8+
9+
FROM $BASE_IMAGE
10+
LABEL maintainers="Compute"
311
LABEL description="Snapshot Validation Webhook"
412
ARG binary=./bin/snapshot-validation-webhook
513

6-
COPY ${binary} snapshot-validation-webhook
14+
COPY --from=builder /go/src/kubernetes-csi/external-snapshotter/${binary} snapshot-validation-webhook
715
ENTRYPOINT ["/snapshot-validation-webhook"]

0 commit comments

Comments
 (0)