mirror of
https://github.com/hanzoai/volume.git
synced 2026-10-01 00:48:00 +00:00
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]>
22 lines
559 B
Docker
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" ]
|