aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-01-20 17:56:26 -0800
committerFuwn <[email protected]>2026-01-20 17:56:26 -0800
commit8a3c129adfbcaad82f2e0e41c8ce42266574ad1f (patch)
tree49c921cb448852e7cb94c62addcf8016da1a127f
parentfix: Respect display.timezone for version tooltip build date (diff)
downloadkaze-8a3c129adfbcaad82f2e0e41c8ce42266574ad1f.tar.xz
kaze-8a3c129adfbcaad82f2e0e41c8ce42266574ad1f.zip
fix: Include commit and build date in Docker build ldflags
-rw-r--r--Dockerfile7
1 files changed, 5 insertions, 2 deletions
diff --git a/Dockerfile b/Dockerfile
index 2010b09..50f7003 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -13,9 +13,12 @@ RUN go mod download
# Copy source code
COPY . .
-# Build the binary
+# Build the binary with version info
RUN CGO_ENABLED=0 GOOS=linux go build \
- -ldflags="-s -w -X main.version=$(git describe --tags --always --dirty 2>/dev/null || echo dev)" \
+ -ldflags="-s -w \
+ -X main.version=$(git describe --tags --always --dirty 2>/dev/null || echo dev) \
+ -X main.commit=$(git rev-parse --short HEAD 2>/dev/null || echo none) \
+ -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
-o kaze ./cmd/kaze
# Runtime stage