Skip to content

Commit 5a8088d

Browse files
antoine-gaillarddatadog-compute-robot
authored andcommitted
[local] Dockerfile
1 parent f21cb02 commit 5a8088d

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
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"]

0 commit comments

Comments
 (0)