-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (26 loc) · 1020 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
# syntax = docker/dockerfile:1.11
########################################
FROM golang:1.23-bookworm AS develop
WORKDIR /src
COPY ["go.mod", "go.sum", "/src"]
RUN go mod download
########################################
FROM --platform=${BUILDPLATFORM} golang:1.23.4-alpine3.21 AS builder
RUN apk update && apk add --no-cache make
ENV GO111MODULE=on
WORKDIR /src
COPY ["go.mod", "go.sum", "/src"]
RUN go mod download && go mod verify
COPY . .
ARG TAG
ARG SHA
RUN make build-all-archs
########################################
FROM --platform=${TARGETARCH} scratch AS hybrid-csi-provisioner
LABEL org.opencontainers.image.source="https://github.com/sergelogvinov/hybrid-csi-plugin" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.description="Hybrid CSI plugin"
COPY --from=gcr.io/distroless/static-debian12:nonroot . .
ARG TARGETARCH
COPY --from=builder /src/bin/hybrid-csi-provisioner-${TARGETARCH} /bin/hybrid-csi-provisioner
ENTRYPOINT ["/bin/hybrid-csi-provisioner"]