build: prevent -dirty tag in Docker builds

Ensure Docker builds don't add a `-dirty` suffix to the version number.

When building for Docker, `make` is called which in turn calls `git describe` to get the version number. Sometimes this would append `-dirty` even when clean.

This change adds `git update-index -q --refresh` before calling `make` to ensure the version tag is returned correctly.
This commit is contained in:
Ryan Smith
2025-04-16 15:34:47 -07:00
parent 41345f04bd
commit dc06d64b5b

View File

@@ -2,6 +2,7 @@
FROM golang:latest AS build-stage FROM golang:latest AS build-stage
WORKDIR /build WORKDIR /build
COPY . . COPY . .
RUN git update-index -q --refresh
RUN make RUN make
FROM alpine:latest FROM alpine:latest