mirror of
https://github.com/hanzoai/migrate.git
synced 2026-09-30 22:55:10 +00:00
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]>
28 lines
518 B
Docker
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"]
|