fix: dockerfile build version

This commit is contained in:
Henrique Dias
2024-07-21 21:25:49 +02:00
parent d1691e1bd1
commit dc45f32af8
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -64,6 +64,7 @@ jobs:
sbom: true sbom: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
build-args: ${{ steps.meta.outputs.args }} build-args: |
VERSION=v${{ steps.meta.outputs.version }}
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max
+2 -2
View File
@@ -1,6 +1,6 @@
FROM golang:1.22-alpine3.20 AS build FROM golang:1.22-alpine3.20 AS build
ARG DOCKER_META_VERSION="untracked" ARG VERSION="untracked"
RUN apk --update add ca-certificates RUN apk --update add ca-certificates
@@ -11,7 +11,7 @@ COPY ./go.sum ./
RUN go mod download RUN go mod download
COPY . /webdav/ 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 FROM scratch