Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d9f636

Browse files
committed
Use dep to build docker image
1 parent 387f79b commit 0d9f636

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Dockerfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
FROM golang:1.10-alpine3.7 AS downloader
22
ARG VERSION
33

4-
RUN apk add --no-cache git gcc musl-dev
4+
RUN apk add --no-cache git gcc musl-dev curl
5+
6+
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
57

68
WORKDIR /go/src/github.com/golang-migrate/migrate
79

8-
ENV DATABASES="postgres mysql redshift cassandra spanner cockroachdb clickhouse"
9-
ENV SOURCES="file go-bindata github aws-s3 google-cloud-storage"
10+
COPY Gopkg.toml Gopkg.lock ./
11+
RUN dep ensure -vendor-only
1012

1113
COPY *.go ./
1214
COPY cli ./cli
1315
COPY database ./database
1416
COPY source ./source
1517

16-
RUN go get -v ./... && \
17-
go get -u github.com/fsouza/fake-gcs-server/fakestorage && \
18-
go get -u github.com/kshvakov/clickhouse && \
19-
go build -a -o build/migrate.linux-386 -ldflags="-X main.Version=${VERSION}" -tags "$DATABASES $SOURCES" ./cli
18+
ENV DATABASES="postgres mysql redshift cassandra spanner cockroachdb clickhouse"
19+
ENV SOURCES="file go-bindata github aws-s3 google-cloud-storage"
20+
21+
RUN go build -a -o build/migrate.linux-386 -ldflags="-X main.Version=${VERSION}" -tags "$DATABASES $SOURCES" ./cli
2022

2123
FROM alpine:3.7
2224

@@ -26,4 +28,4 @@ COPY --from=downloader /go/src/github.com/golang-migrate/migrate/build/migrate.l
2628
RUN chmod u+x /migrate
2729

2830
ENTRYPOINT ["/migrate"]
29-
CMD ["--help"]
31+
CMD ["--help"]

0 commit comments

Comments
 (0)