mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2025-12-11 23:50:04 +01:00
Go v1.11 (#60)
* Go v1.11 * [Go Modules](https://github.com/golang/go/wiki/Modules) * [GolangCI-Lint](https://github.com/golangci/golangci-lint) * [Distroless](https://github.com/GoogleContainerTools/distroless) docker image
This commit is contained in:
parent
abc544b368
commit
da3d9525cf
8 changed files with 47 additions and 117 deletions
22
Dockerfile
22
Dockerfile
|
|
@ -1,5 +1,5 @@
|
|||
# build image
|
||||
FROM golang:1.10 as build
|
||||
FROM golang:1.11 as build
|
||||
|
||||
# required to force cgo (for sqlite driver) with cross compile
|
||||
ENV CGO_ENABLED 1
|
||||
|
|
@ -13,21 +13,17 @@ RUN apt-get update \
|
|||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# development dependencies
|
||||
RUN curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64 \
|
||||
&& chmod +x /usr/local/bin/dep
|
||||
RUN go get gopkg.in/alecthomas/gometalinter.v2 \
|
||||
&& gometalinter.v2 --install
|
||||
RUN curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
|
||||
| sh -s v1.12.3
|
||||
|
||||
# copy source files
|
||||
COPY . /go/src/github.com/amacneil/dbmate
|
||||
WORKDIR /go/src/github.com/amacneil/dbmate
|
||||
COPY . /src
|
||||
WORKDIR /src
|
||||
|
||||
# build
|
||||
RUN make dep install build
|
||||
RUN make build
|
||||
|
||||
# runtime image
|
||||
FROM debian:stretch-slim
|
||||
COPY --from=build /go/src/github.com/amacneil/dbmate/dist/dbmate-linux-amd64 \
|
||||
/usr/local/bin/dbmate
|
||||
WORKDIR /app
|
||||
ENTRYPOINT ["/usr/local/bin/dbmate"]
|
||||
FROM gcr.io/distroless/base
|
||||
COPY --from=build /src/dist/dbmate-linux-amd64 /dbmate
|
||||
ENTRYPOINT ["/dbmate"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue