feat: print git commit during startup

This commit is contained in:
Max Richter
2025-10-11 12:12:48 +02:00
parent f3f4986bc1
commit d53a6745aa
2 changed files with 5 additions and 1 deletions

View File

@@ -1,10 +1,11 @@
FROM golang:1.24.7 AS build
ARG GIT_COMMIT=unknown
WORKDIR /src
COPY . .
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -trimpath -ldflags="-s -w" \
go build -trimpath -ldflags="-s -w -X main.commit=${GIT_COMMIT}" \
-o /out/server ./server/cmd/marka-server
FROM scratch