github.com/tooolbox/migrate/v4@v4.6.2-0.20200325001913-461b03b92064/Dockerfile (about) 1 FROM golang:1.14-alpine3.11 AS builder 2 ARG VERSION 3 4 RUN apk add --no-cache git gcc musl-dev 5 6 # dependencies for neo4j 7 RUN apk add --update --no-cache ca-certificates cmake make g++ openssl-libs-static openssl-dev git curl pkgconfig 8 9 # build seabolt for neo4j driver 10 RUN git clone --depth 1 -b 1.7 https://github.com/neo4j-drivers/seabolt.git /seabolt 11 WORKDIR /seabolt/build 12 RUN cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_LIBDIR=lib .. && cmake --build . --target install 13 14 WORKDIR /go/src/github.com/golang-migrate/migrate 15 16 ENV GO111MODULE=on 17 ENV DATABASES="postgres mysql redshift cassandra spanner cockroachdb clickhouse mongodb sqlserver firebird sqlite3 neo4j" 18 ENV SOURCES="file go_bindata github github_ee aws_s3 google_cloud_storage godoc_vfs gitlab" 19 20 COPY go.mod go.sum ./ 21 22 RUN go mod download 23 24 COPY . ./ 25 26 RUN go build -a -o build/migrate.linux-386 -ldflags="-s -w -X main.Version=${VERSION}" -tags "$DATABASES $SOURCES" ./cmd/migrate 27 28 FROM alpine:3.11 29 30 RUN apk add --no-cache ca-certificates 31 32 COPY --from=builder /usr/local/lib/libseabolt* /lib/ 33 34 COPY --from=builder /go/src/github.com/golang-migrate/migrate/build/migrate.linux-386 /usr/local/bin/migrate 35 RUN ln -s /usr/local/bin/migrate /migrate 36 37 ENTRYPOINT ["migrate"] 38 CMD ["--help"]