Add version
This commit is contained in:
+10
-1
@@ -1,15 +1,24 @@
|
||||
FROM golang:1.27-alpine AS builder
|
||||
|
||||
ARG VERSION=dev # maintained in build.sh
|
||||
ARG GIT_SHA=0
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
COPY go.mod ./
|
||||
|
||||
COPY index.html.tmpl main.go ./
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o beam .
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-X main.version=${VERSION}-${GIT_SHA}" -a -installsuffix cgo -o beam .
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
ARG VERSION=0.1.0
|
||||
ARG GIT_SHA=dev
|
||||
|
||||
LABEL org.opencontainers.image.version="${VERSION}"
|
||||
LABEL org.opencontainers.image.revision="${GIT_SHA}"
|
||||
|
||||
RUN apk add mailcap \
|
||||
&& adduser -D -u 1000 beam \
|
||||
&& mkdir /uploads \
|
||||
|
||||
Reference in New Issue
Block a user