fix(docker): inject version metadata ldflags in Dockerfile.launcher
Mirror the ldflags from web/Makefile (Version, GitCommit, BuildTime, GoVersion) into the picoclaw-launcher go build command so Docker-built launcher images include proper version/build metadata. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cc6e247fa5
commit
386ee4fa71
1 changed files with 9 additions and 3 deletions
|
|
@ -38,8 +38,14 @@ COPY --from=frontend /src/web/backend/dist web/backend/dist
|
||||||
RUN make build
|
RUN make build
|
||||||
|
|
||||||
# Build picoclaw-launcher binary (frontend already built in stage 1)
|
# Build picoclaw-launcher binary (frontend already built in stage 1)
|
||||||
RUN CGO_ENABLED=0 go build -v -tags goolm,stdjson \
|
# Mirror ldflags from web/Makefile to inject version metadata
|
||||||
-ldflags "-s -w" \
|
RUN CONFIG_PKG=github.com/sipeed/picoclaw/pkg/config && \
|
||||||
|
VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo dev) && \
|
||||||
|
GIT_COMMIT=$(git rev-parse --short=8 HEAD 2>/dev/null || echo dev) && \
|
||||||
|
BUILD_TIME=$(date +%FT%T%z) && \
|
||||||
|
GO_VERSION=$(go env GOVERSION) && \
|
||||||
|
CGO_ENABLED=0 go build -v -tags goolm,stdjson \
|
||||||
|
-ldflags "-X ${CONFIG_PKG}.Version=${VERSION} -X ${CONFIG_PKG}.GitCommit=${GIT_COMMIT} -X ${CONFIG_PKG}.BuildTime=${BUILD_TIME} -X ${CONFIG_PKG}.GoVersion=${GO_VERSION} -s -w" \
|
||||||
-o build/picoclaw-launcher ./web/backend/
|
-o build/picoclaw-launcher ./web/backend/
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue