Include the version in the initial log output

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
2023-07-30 13:51:16 +01:00
parent bfe1115cb5
commit 15625050c7
3 changed files with 6 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG VERSION="dev"
RUN apk update && apk add -U --no-cache ca-certificates
@@ -12,7 +13,7 @@ ADD go.mod go.sum ./
RUN go mod download
ADD main.go .
ADD pkg/ ./pkg
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-w -s" -o tailscale-exporter main.go
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-w -s -X 'main.Version=${VERSION}'" -o tailscale-exporter main.go
FROM --platform=${TARGETPLATFORM:-linux/amd64} scratch
WORKDIR /app/