diff options
| author | Fuwn <[email protected]> | 2026-01-20 17:56:26 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-01-20 17:56:26 -0800 |
| commit | 8a3c129adfbcaad82f2e0e41c8ce42266574ad1f (patch) | |
| tree | 49c921cb448852e7cb94c62addcf8016da1a127f | |
| parent | fix: Respect display.timezone for version tooltip build date (diff) | |
| download | kaze-8a3c129adfbcaad82f2e0e41c8ce42266574ad1f.tar.xz kaze-8a3c129adfbcaad82f2e0e41c8ce42266574ad1f.zip | |
fix: Include commit and build date in Docker build ldflags
| -rw-r--r-- | Dockerfile | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 |