mirror of
https://github.com/hacdias/webdav.git
synced 2026-09-22 03:20:41 +08:00
fix: dockerfile build version
This commit is contained in:
@@ -64,6 +64,7 @@ jobs:
|
||||
sbom: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: ${{ steps.meta.outputs.args }}
|
||||
build-args: |
|
||||
VERSION=v${{ steps.meta.outputs.version }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
FROM golang:1.22-alpine3.20 AS build
|
||||
|
||||
ARG DOCKER_META_VERSION="untracked"
|
||||
ARG VERSION="untracked"
|
||||
|
||||
RUN apk --update add ca-certificates
|
||||
|
||||
@@ -11,7 +11,7 @@ COPY ./go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . /webdav/
|
||||
RUN go build -o main -ldflags="-X 'github.com/hacdias/webdav/v4/cmd.version=$DOCKER_META_VERSION'" .
|
||||
RUN go build -o main -ldflags="-X 'github.com/hacdias/webdav/v4/cmd.version=$VERSION'" .
|
||||
|
||||
FROM scratch
|
||||
|
||||
|
||||
Reference in New Issue
Block a user