mirror of
https://github.com/lone-cloud/prism
synced 2026-06-03 08:43:10 -07:00
fix: correctly inject the version from the VERION file into the code on build
This commit is contained in:
parent
96f413c9f9
commit
98b18e28ca
1 changed files with 2 additions and 3 deletions
|
|
@ -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 .
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue