fix: dockerfile

pull/7/head
sundowndev 2021-07-07 16:47:58 +02:00
parent f7434d3cdb
commit 7ef789b419
1 changed files with 3 additions and 12 deletions

View File

@ -1,12 +1,3 @@
FROM golang:1.16.2-alpine
WORKDIR /app
COPY . .
RUN apk add git
RUN VERSION=$(git describe --exact-match 2>/dev/null || git rev-parse --short HEAD)
RUN go build -ldflags="-X github.com/sundowndev/goreleaser-template/version.Version=${VERSION}" -v -o myproject .
ENTRYPOINT ["/app/myproject"]
FROM scratch
COPY myproject /usr/bin/myproject
ENTRYPOINT ["/usr/bin/myproject"]