Skip to content

Commit

Permalink
Merge pull request #176 from numary/feature/num-417-ledger-version-se…
Browse files Browse the repository at this point in the history
…ems-not-passed-to-the

Add missing build args when building docker image.
  • Loading branch information
gfyrag authored Mar 25, 2022
2 parents 914c640 + c43a0a9 commit a479d5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,6 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/numary/ledger:latest,ghcr.io/numary/ledger:${{ github.event.release.tag_name }}
build-args:
APP_SHA: ${{ env.GITHUB_SHA }}
VERSION: ${{ github.event.release.tag_name }}
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
FROM golang:1.18-alpine as src-alpine
ARG VERSION=latest
ARG APP_SHA
RUN apk add --no-cache git gcc build-base
COPY . /app
WORKDIR /app
RUN CGO_ENABLED=1 GOOS=linux go build -o numary ./
RUN CGO_ENABLED=1 GOOS=linux go build -o numary \
-ldflags="-X github.com/numary/ledger/cmd.Version=${VERSION} \
-X github.com/numary/ledger/cmd.BuildDate=$(date +%s) \
-X github.com/numary/ledger/cmd.Commit=${APP_SHA}" ./

FROM alpine
RUN apk add --no-cache ca-certificates curl
Expand Down

0 comments on commit a479d5b

Please sign in to comment.