Use Go 1.11 (with modules enabled on alpine linux 3.8) for docker builds

This commit is contained in:
Dale Hui 2018-09-04 22:18:49 -07:00
parent 16f2b1736e
commit 93d53a5ae8
1 changed files with 5 additions and 12 deletions

View File

@ -1,26 +1,19 @@
FROM golang:1.10-alpine3.7 AS downloader FROM golang:1.11-alpine3.8 AS downloader
ARG VERSION ARG VERSION
RUN apk add --no-cache git gcc musl-dev curl RUN apk add --no-cache git gcc musl-dev
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
COPY Gopkg.toml Gopkg.lock ./ COPY . ./
RUN dep ensure -vendor-only
COPY *.go ./
COPY cli ./cli
COPY database ./database
COPY source ./source
ENV GO111MODULE=on
ENV DATABASES="postgres mysql redshift cassandra spanner cockroachdb clickhouse" ENV DATABASES="postgres mysql redshift cassandra spanner cockroachdb clickhouse"
ENV SOURCES="file go_bindata github aws_s3 google_cloud_storage" ENV SOURCES="file go_bindata github aws_s3 google_cloud_storage"
RUN 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.8
RUN apk add --no-cache ca-certificates RUN apk add --no-cache ca-certificates