diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 84775cd..f6e82ae 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 6025820..b4bf097 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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