Files
zeekayandHanzo Dev db24923e99 build: Go builder base to 1.26.5, GOTOOLCHAIN=auto
Currency bump. No go.mod directive changes.

The golang images ship GOTOOLCHAIN=local, so the moment a go.mod
directive moves past the image's Go version the build hard-fails
mid-stage. GOTOOLCHAIN=auto lets the toolchain resolve instead; the
pinned base stays the hermetic fast path.
alpine3.21 is no longer published for any golang 1.26.x tag; 3.23 is the
lowest alpine variant still cut for 1.26.5. The builder is CGO_ENABLED=0,
so the static binary is unaffected and the alpine:3.21 runtime stage stands.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-01 16:34:22 -07:00

28 lines
518 B
Docker

FROM golang:1.26.5-alpine3.23 AS builder
ENV GOTOOLCHAIN=auto
ARG VERSION
RUN apk add --no-cache git gcc musl-dev make
WORKDIR /go/src/github.com/golang-migrate/migrate
ENV GO111MODULE=on
COPY go.mod go.sum ./
RUN go mod download
COPY . ./
RUN make build-docker
FROM alpine:3.21
RUN apk add --no-cache ca-certificates
COPY --from=builder /go/src/github.com/golang-migrate/migrate/build/migrate.linux-386 /usr/local/bin/migrate
RUN ln -s /usr/local/bin/migrate /migrate
ENTRYPOINT ["migrate"]
CMD ["--help"]