2020-02-10 11:22:37 +00:00
|
|
|
FROM golang:1.13-alpine3.11 AS downloader
|
2019-06-09 07:24:20 +00:00
|
|
|
ARG VERSION
|
|
|
|
|
|
|
|
RUN apk add --no-cache git gcc musl-dev
|
|
|
|
|
|
|
|
WORKDIR /go/src/github.com/golang-migrate/migrate
|
|
|
|
|
|
|
|
COPY . ./
|
|
|
|
|
|
|
|
ENV GO111MODULE=on
|
2020-02-10 11:22:37 +00:00
|
|
|
ENV DATABASES="postgres mysql redshift cassandra spanner cockroachdb clickhouse mongodb sqlserver firebird"
|
2019-07-17 22:25:42 +00:00
|
|
|
ENV SOURCES="file go_bindata github github_ee aws_s3 google_cloud_storage godoc_vfs gitlab"
|
2019-06-09 07:24:20 +00:00
|
|
|
|
2019-10-14 14:10:48 +00:00
|
|
|
RUN go build -a -o build/migrate.linux-386 -ldflags="-s -w -X main.Version=${VERSION}" -tags "$DATABASES $SOURCES" ./cmd/migrate
|
2019-06-09 07:24:20 +00:00
|
|
|
|
2020-02-10 11:22:37 +00:00
|
|
|
FROM alpine:3.11
|
2019-06-09 07:24:20 +00:00
|
|
|
|
|
|
|
RUN apk add --no-cache ca-certificates
|
|
|
|
|
|
|
|
COPY --from=downloader /go/src/github.com/golang-migrate/migrate/build/migrate.linux-386 /migrate
|
|
|
|
|
|
|
|
ENTRYPOINT ["/migrate"]
|
|
|
|
CMD ["--help"]
|