2019-07-12 06:22:30 +00:00
|
|
|
FROM golang:1.12-alpine3.10 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-05-27 06:20:47 +00:00
|
|
|
ENV DATABASES="postgres mysql redshift cassandra spanner cockroachdb clickhouse mongodb sqlserver"
|
2019-06-16 19:48:01 +00:00
|
|
|
ENV SOURCES="file go_bindata github github_ee aws_s3 google_cloud_storage godoc_vfs gitlab"
|
2018-06-11 11:18:05 +00:00
|
|
|
|
2019-07-12 17:54:42 +00:00
|
|
|
RUN go build -a -o build/migrate.linux-386 -ldflags="-s -w -X main.Version=${VERSION}" -tags "$DATABASES $SOURCES" ./cmd/migrate
|
2018-05-08 19:13:53 +00:00
|
|
|
|
2019-07-12 06:22:30 +00:00
|
|
|
FROM alpine:3.10
|
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"]
|