mirror of
https://github.com/status-im/migrate.git
synced 2025-02-24 00:38:07 +00:00
Use dep to build docker image
This commit is contained in:
parent
387f79be13
commit
0d9f636356
18
Dockerfile
18
Dockerfile
@ -1,22 +1,24 @@
|
|||||||
FROM golang:1.10-alpine3.7 AS downloader
|
FROM golang:1.10-alpine3.7 AS downloader
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
|
|
||||||
RUN apk add --no-cache git gcc musl-dev
|
RUN apk add --no-cache git gcc musl-dev curl
|
||||||
|
|
||||||
|
RUN curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 && chmod +x /usr/local/bin/dep
|
||||||
|
|
||||||
WORKDIR /go/src/github.com/golang-migrate/migrate
|
WORKDIR /go/src/github.com/golang-migrate/migrate
|
||||||
|
|
||||||
ENV DATABASES="postgres mysql redshift cassandra spanner cockroachdb clickhouse"
|
COPY Gopkg.toml Gopkg.lock ./
|
||||||
ENV SOURCES="file go-bindata github aws-s3 google-cloud-storage"
|
RUN dep ensure -vendor-only
|
||||||
|
|
||||||
COPY *.go ./
|
COPY *.go ./
|
||||||
COPY cli ./cli
|
COPY cli ./cli
|
||||||
COPY database ./database
|
COPY database ./database
|
||||||
COPY source ./source
|
COPY source ./source
|
||||||
|
|
||||||
RUN go get -v ./... && \
|
ENV DATABASES="postgres mysql redshift cassandra spanner cockroachdb clickhouse"
|
||||||
go get -u github.com/fsouza/fake-gcs-server/fakestorage && \
|
ENV SOURCES="file go-bindata github aws-s3 google-cloud-storage"
|
||||||
go get -u github.com/kshvakov/clickhouse && \
|
|
||||||
go build -a -o build/migrate.linux-386 -ldflags="-X main.Version=${VERSION}" -tags "$DATABASES $SOURCES" ./cli
|
RUN go build -a -o build/migrate.linux-386 -ldflags="-X main.Version=${VERSION}" -tags "$DATABASES $SOURCES" ./cli
|
||||||
|
|
||||||
FROM alpine:3.7
|
FROM alpine:3.7
|
||||||
|
|
||||||
@ -26,4 +28,4 @@ COPY --from=downloader /go/src/github.com/golang-migrate/migrate/build/migrate.l
|
|||||||
RUN chmod u+x /migrate
|
RUN chmod u+x /migrate
|
||||||
|
|
||||||
ENTRYPOINT ["/migrate"]
|
ENTRYPOINT ["/migrate"]
|
||||||
CMD ["--help"]
|
CMD ["--help"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user