mirror of
https://github.com/hanzoai/s3-csi.git
synced 2026-09-30 23:52:32 +00:00
The official golang images set GOTOOLCHAIN=local, so a builder stage older
than the governing go.mod directive does not upgrade — it dies:
go: go.mod requires go >= 1.26.5 (running go 1.26.4; GOTOOLCHAIN=local)
go.mod here is go 1.26.5, and the two dev builders were on golang:1.24-alpine
and golang:1.25-alpine.
Two independent halves:
1. pin the dev builders to golang:1.26.5-alpine;
2. set ENV GOTOOLCHAIN=auto in every Go builder stage — including the two
images hanzo.yml actually publishes (s3-csi, s3-mount). Those sit on the
floating golang:1.26-alpine tag, which satisfies the directive today and
silently stops satisfying it the day go.mod crosses 1.27. GOTOOLCHAIN=auto
makes that a checksum-verified download (sum.golang.org) rather than a
failed release build. Their pins are left alone; only the ENV is added.
Separately, and NOT fixed here because it is a different bug: both .dev
builders `git clone https://github.com/s3/s3`, which is HTTP 404 — a stale
pre-rebrand URL. `make container-csi` / `container-mount` therefore cannot
succeed regardless of the Go pin. They are stale duplicates of
cmd/s3-csi-driver/Dockerfile and cmd/s3-mount/Dockerfile, which build the
same binaries correctly against github.com/hanzoai/s3 and are the ones
hanzo.yml and the integration workflow use. Deleting them and dropping the
Makefile targets is the DRY fix, but that is a deliberate call, not a
side effect of a toolchain patch.
Co-authored-by: Hanzo Dev <[email protected]>
22 lines
651 B
Docker
22 lines
651 B
Docker
FROM golang:1.26.5-alpine as builder
|
|
ENV GOTOOLCHAIN=auto
|
|
|
|
RUN apk add git g++
|
|
|
|
RUN mkdir -p /go/src/github.com/s3/
|
|
RUN git clone https://github.com/s3/s3 /go/src/github.com/s3/s3
|
|
RUN cd /go/src/github.com/s3/s3/s3 && go install
|
|
|
|
WORKDIR /go/src/github.com/s3/s3-csi-driver
|
|
COPY . .
|
|
RUN cd /go/src/github.com/s3/s3-csi-driver && go build -ldflags="-s -w" -o /s3-csi-driver ./cmd/s3-csi-driver/main.go
|
|
|
|
FROM alpine AS final
|
|
RUN apk add fuse
|
|
LABEL org.opencontainers.image.source="https://github.com/hanzoai/s3-csi"
|
|
COPY --from=builder /go/bin/s3 /usr/bin/
|
|
COPY --from=builder /s3-csi-driver /
|
|
|
|
RUN chmod +x /s3-csi-driver
|
|
ENTRYPOINT ["/s3-csi-driver"]
|