fix dockerfile version and deps

Signed-off-by: Alexandre MARRE <me@itsalex.fr>
This commit is contained in:
ItsAlex 2018-05-09 23:26:37 +02:00 committed by Alexandre MARRE
parent a0b03c3a68
commit 31daa8dad3
No known key found for this signature in database
GPG Key ID: D13067073B9A98A9
2 changed files with 6 additions and 2 deletions

View File

@ -1,9 +1,13 @@
FROM golang:1.10-alpine3.7 AS downloader
ARG VERSION
RUN apk add --no-cache git gcc musl-dev
WORKDIR /go/src/github.com/golang-migrate/migrate
ENV DATABASES="postgres mysql redshift cassandra spanner cockroachdb clickhouse"
ENV SOURCES="file go-bindata github aws-s3 google-cloud-storage"
COPY *.go ./
COPY cli ./cli
COPY database ./database
@ -12,7 +16,7 @@ COPY source ./source
RUN go get -v ./... && \
go get -u github.com/fsouza/fake-gcs-server/fakestorage && \
go get -u github.com/kshvakov/clickhouse && \
GOOS=linux GOARCH=386 go build -a -o build/migrate.linux-386 -ldflags='-X main.Version=$(VERSION)' -tags '$(DATABASE) $(SOURCE)' ./cli
go build -a -o build/migrate.linux-386 -ldflags="-X main.Version=${VERSION}" -tags "$DATABASES $SOURCES" ./cli
FROM alpine:3.7

View File

@ -1,5 +1,5 @@
#!/bin/bash
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin && \
docker build . -t migrate/migrate:"$TRAVIS_TAG" && \
docker build --build-arg VERSION="$TRAVIS_TAG" . -t migrate/migrate:"$TRAVIS_TAG" && \
docker push migrate/migrate:"$TRAVIS_TAG"