Files
volume/examples/distroless/Dockerfile.provisioner
zeekayandHanzo Dev 61bfa3f65a go 1.26.8
One toolchain across the estate. The tree carried 1.26.0, .1, .3, .4 and .5
at once, so which compiler built a binary depended on which repo it came
from.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-08 23:52:45 -07:00

22 lines
559 B
Docker

FROM golang:1.26.8-alpine AS builder
ARG GIT_REPO
ARG GIT_BRANCH
RUN apk add --no-cache git
ENV GIT_REPO=$GIT_REPO
ENV GIT_BRANCH=$GIT_BRANCH
RUN mkdir /src && \
git clone --depth 1 --branch "${GIT_BRANCH}" "${GIT_REPO}" /src && \
cd /src && \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X main.VERSION=dev -extldflags -static -s -w" -o /local-path-provisioner && \
chmod 777 /local-path-provisioner
FROM scratch
COPY --from=builder /local-path-provisioner /local-path-provisioner
ENTRYPOINT [ "/local-path-provisioner" ]