add version information
This commit is contained in:
@@ -9,8 +9,11 @@ COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
# Copy the source code
|
||||
COPY . .
|
||||
ARG VERSION="dev"
|
||||
ARG COMMIT="unset"
|
||||
ARG DATE="unset"
|
||||
# Build the Go application (strip debug info for smaller size)
|
||||
RUN go build -trimpath -ldflags="-s -w" -o kontor cmd/kontor/main.go
|
||||
RUN go build -trimpath -ldflags="-s -w -X kontor-api-gin/internal/globals.Version=${VERSION} -X kontor-api-gin/internal/globals.Commit=${COMMIT} -X kontor-api-gin/internal/globals.Date=${DATE}" -o kontor cmd/kontor/main.go
|
||||
|
||||
# ---------- Stage 2: Final ----------
|
||||
FROM alpine:latest
|
||||
|
||||
Reference in New Issue
Block a user