2018-09-05 05:18:49 +00:00
|
|
|
FROM golang:1.11-alpine3.8 AS downloader
|
2018-05-09 21:26:37 +00:00
|
|
|
ARG VERSION
|
2018-05-08 19:13:53 +00:00
|
|
|
|
2018-09-05 05:18:49 +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-09-05 05:18:49 +00:00
|
|
|
COPY . ./
|
2018-05-08 19:13:53 +00:00
|
|
|
|
2018-09-05 05:18:49 +00:00
|
|
|
ENV GO111MODULE=on
|
2018-06-11 11:18:05 +00:00
|
|
|
ENV DATABASES="postgres mysql redshift cassandra spanner cockroachdb clickhouse"
|
2018-06-12 08:18:27 +00:00
|
|
|
ENV SOURCES="file go_bindata github aws_s3 google_cloud_storage"
|
2018-06-11 11:18:05 +00:00
|
|
|
|
|
|
|
RUN go build -a -o build/migrate.linux-386 -ldflags="-X main.Version=${VERSION}" -tags "$DATABASES $SOURCES" ./cli
|
2018-05-08 19:13:53 +00:00
|
|
|
|
2018-09-05 05:18:49 +00:00
|
|
|
FROM alpine:3.8
|
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"]
|