ntfy-alertmanager/docker/Dockerfile-dev
Thorben Günther 84c4c45d5b
version: Use linker flag
Embedding the version file is slightly annoying for packaging, because
the release tarball is not a git repository and so "go generate" would
fail. Instead a packager would have to manually create the version.txt
file.
With using a linker flag, the version string has a graceful fallback.
2023-02-16 13:06:21 +01:00

14 lines
297 B
Text

FROM golang:alpine as build
WORKDIR /app
COPY . .
RUN apk add --no-cache git
RUN go build -ldflags="-X main.version=$(git describe --long)" -o /app/ntfy-alertmanager
FROM alpine:latest
WORKDIR /
COPY --from=build /app/ntfy-alertmanager /ntfy-alertmanager
ENTRYPOINT [ "./ntfy-alertmanager" ]