From 98b18e28cab811cf2105b4d792734f0ce08d9d85 Mon Sep 17 00:00:00 2001 From: lone-cloud Date: Fri, 13 Feb 2026 22:42:12 -0800 Subject: [PATCH] fix: correctly inject the version from the VERION file into the code on build --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 88c8c6f..5b06f7c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ FROM golang:1.26-alpine3.23 AS builder -ARG VERSION=dev - WORKDIR /build RUN apk add --no-cache git ca-certificates @@ -11,7 +9,8 @@ RUN go mod download COPY . . -RUN CGO_ENABLED=0 GOOS=linux go build \ +RUN VERSION=$(cat VERSION 2>/dev/null || echo "dev") && \ + CGO_ENABLED=0 GOOS=linux go build \ -trimpath \ -ldflags="-w -s -X main.version=${VERSION}" \ -o prism .