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
9a2351d121
commit
5556d7f37f
1 changed files with 2 additions and 3 deletions
|
|
@ -1,7 +1,5 @@
|
||||||
FROM golang:1.26-alpine3.23 AS builder
|
FROM golang:1.26-alpine3.23 AS builder
|
||||||
|
|
||||||
ARG VERSION=dev
|
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
RUN apk add --no-cache git ca-certificates
|
RUN apk add --no-cache git ca-certificates
|
||||||
|
|
@ -11,7 +9,8 @@ RUN go mod download
|
||||||
|
|
||||||
COPY . .
|
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 \
|
-trimpath \
|
||||||
-ldflags="-w -s -X main.version=${VERSION}" \
|
-ldflags="-w -s -X main.version=${VERSION}" \
|
||||||
-o prism .
|
-o prism .
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue