2022-08-19 16:34:07 +00:00
|
|
|
FROM golang:1.16-alpine3.13 AS builder
|
2019-06-09 07:24:20 +00:00
|
|
|
ARG VERSION
|
|
|
|
|
2022-08-19 16:34:07 +00:00
|
|
|
RUN apk add --no-cache git gcc musl-dev make
|
2019-06-09 07:24:20 +00:00
|
|
|
|
|
|
|
WORKDIR /go/src/github.com/golang-migrate/migrate
|
|
|
|
|
|
|
|
ENV GO111MODULE=on
|
|
|
|
|
2022-08-19 16:34:07 +00:00
|
|
|
COPY go.mod go.sum ./
|
|
|
|
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
COPY . ./
|
|
|
|
|
|
|
|
RUN make build-docker
|
2019-06-09 07:24:20 +00:00
|
|
|
|
2022-08-19 16:34:07 +00:00
|
|
|
FROM alpine:3.13
|
2019-06-09 07:24:20 +00:00
|
|
|
|
|
|
|
RUN apk add --no-cache ca-certificates
|
|
|
|
|
2022-08-19 16:34:07 +00:00
|
|
|
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
|
2019-06-09 07:24:20 +00:00
|
|
|
|
2022-08-19 16:34:07 +00:00
|
|
|
ENTRYPOINT ["migrate"]
|
2019-06-09 07:24:20 +00:00
|
|
|
CMD ["--help"]
|