add dockerfile
parent
590e8ca4a9
commit
0861890120
|
@ -0,0 +1,14 @@
|
||||||
|
FROM golang:1.16.2-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN apk add git
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
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}" -v -o myproject .
|
||||||
|
|
||||||
|
ENTRYPOINT ["/app/myproject"]
|
Loading…
Reference in New Issue