From 1295ac32256503692882aa8f585366d26656be18 Mon Sep 17 00:00:00 2001 From: Jeremy Lewi Date: Tue, 12 Nov 2024 05:41:07 -0800 Subject: [PATCH] Fix Dockerfile: Properly set the LDFLAG to bake in version information. --- app/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Dockerfile b/app/Dockerfile index 1fed4132..8e3c2b6d 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -16,9 +16,9 @@ WORKDIR /workspace/app ## Build # The LDFLAG can't be specified multiple times so we use an environment variable to build it up over multiple lines # -a flag forces a rebuild of the package and its sources; is that what we want? -RUN LDFLAGS="-s -w -X github.com/jlewi/foyle/app/cmd/commands.version=${VERSION}" && \ - LDFLAGS="${LDFLAGS} -X github.com/jlewi/foyle/app/cmd/commands.commit=${COMMIT}" && \ - LDFLAGS="${LDFLAGS} -X github.com/jlewi/foyle/app/cmd/commands.date=${DATE}" && \ +RUN LDFLAGS="-s -w -X github.com/jlewi/foyle/app/cmd.version=${VERSION}" && \ + LDFLAGS="${LDFLAGS} -X github.com/jlewi/foyle/app/cmd.commit=${COMMIT}" && \ + LDFLAGS="${LDFLAGS} -X github.com/jlewi/foyle/app/cmd.date=${DATE}" && \ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on \ go build \ -ldflags "${LDFLAGS}" \