mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2025-12-11 23:50:04 +01:00
parent
f150d6aeff
commit
4e01c75eca
5 changed files with 29 additions and 19 deletions
10
Dockerfile
10
Dockerfile
|
|
@ -1,4 +1,5 @@
|
|||
FROM golang:1.9
|
||||
# build image
|
||||
FROM golang:1.9 as build
|
||||
|
||||
# required to force cgo (for sqlite driver) with cross compile
|
||||
ENV CGO_ENABLED 1
|
||||
|
|
@ -13,6 +14,9 @@ COPY . $GOPATH/src/github.com/amacneil/dbmate
|
|||
WORKDIR $GOPATH/src/github.com/amacneil/dbmate
|
||||
|
||||
# build
|
||||
RUN go install -v ./cmd/dbmate
|
||||
RUN go build -ldflags '-s' -o /go/bin/dbmate ./cmd/dbmate
|
||||
|
||||
CMD dbmate
|
||||
# runtime image
|
||||
FROM debian:stretch-slim
|
||||
COPY --from=build /go/bin/dbmate /usr/local/bin/dbmate
|
||||
ENTRYPOINT ["dbmate"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue