Skip to content

Commit

Permalink
fix: dockerfile build version
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Jul 21, 2024
1 parent d1691e1 commit dc45f32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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

Expand Down

0 comments on commit dc45f32

Please sign in to comment.