Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Fix version embedding in Docker builds

rcourtman497bdb625e3a
diff --git a/Dockerfile b/Dockerfile
index 7809e76f3d..eb9e7096a0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -47,8 +47,10 @@ COPY --from=frontend-builder /app/frontend-modern/dist ./internal/api/frontend-m
RUN --mount=type=cache,id=pulse-go-mod,target=/go/pkg/mod \
--mount=type=cache,id=pulse-go-build,target=/root/.cache/go-build \
VERSION="v$(cat VERSION | tr -d '\n')" && \
+ BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") && \
+ GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown") && \
CGO_ENABLED=0 GOOS=linux go build \
- -ldflags="-s -w -X github.com/rcourtman/pulse-go-rewrite/internal/dockeragent.Version=${VERSION}" \
+ -ldflags="-s -w -X main.Version=${VERSION} -X main.BuildTime=${BUILD_TIME} -X main.GitCommit=${GIT_COMMIT} -X github.com/rcourtman/pulse-go-rewrite/internal/dockeragent.Version=${VERSION}" \
-trimpath \
-o pulse ./cmd/pulse