2019-03-02 10:04:53 +00:00
|
|
|
FROM golang:1.12-alpine3.9 AS downloader
|
2018-05-09 21:26:37 +00:00
|
|
|
ARG VERSION
|
2018-05-08 19:13:53 +00:00
|
|
|
|
2018-10-10 23:16:03 +00:00
|
|
|
RUN apk add --no-cache git gcc musl-dev
|
2018-05-08 19:13:53 +00:00
|
|
|
|
|
|
|
WORKDIR /go/src/github.com/golang-migrate/migrate
|
|
|
|
|
2018-10-10 23:16:03 +00:00
|
|
|
COPY . ./
|
2018-05-08 19:13:53 +00:00
|
|
|
|
2018-10-10 22:09:03 +00:00
|
|
|
ENV GO111MODULE=on
|
2019-02-18 09:15:23 +00:00
|
|
|
ENV DATABASES="postgres mysql redshift cassandra spanner cockroachdb clickhouse mongodb"
|
2019-03-11 01:38:23 +00:00
|
|
|
ENV SOURCES="file go_bindata github aws_s3 google_cloud_storage gitlab"
|
2018-06-11 11:18:05 +00:00
|
|
|
|
2018-11-19 13:17:38 +00:00
|
|
|
RUN go build -a -o build/migrate.linux-386 -ldflags="-X main.Version=${VERSION}" -tags "$DATABASES $SOURCES" ./cmd/migrate
|
2018-05-08 19:13:53 +00:00
|
|
|
|
2019-02-19 11:25:47 +00:00
|
|
|
FROM alpine:3.9
|
2018-05-08 19:13:53 +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"]
|
2018-06-11 11:18:05 +00:00
|
|
|
CMD ["--help"]
|