Skip to content

Commit 44ca592

Browse files
Set newt version in dockerfile
1 parent e1edbce commit 44ca592

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.github/workflows/cicd.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ jobs:
269269
context: .
270270
push: true
271271
platforms: linux/amd64
272+
build-args: VERSION=${{ env.TAG }}
272273
tags: |
273274
${{ env.GHCR_IMAGE }}:amd64-${{ env.TAG }}
274275
${{ env.DOCKERHUB_IMAGE }}:amd64-${{ env.TAG }}
@@ -393,6 +394,7 @@ jobs:
393394
context: .
394395
push: true
395396
platforms: linux/arm64
397+
build-args: VERSION=${{ env.TAG }}
396398
tags: |
397399
${{ env.GHCR_IMAGE }}:arm64-${{ env.TAG }}
398400
${{ env.DOCKERHUB_IMAGE }}:arm64-${{ env.TAG }}
@@ -509,6 +511,7 @@ jobs:
509511
context: .
510512
push: true
511513
platforms: linux/arm/v7
514+
build-args: VERSION=${{ env.TAG }}
512515
tags: |
513516
${{ env.GHCR_IMAGE }}:armv7-${{ env.TAG }}
514517
${{ env.DOCKERHUB_IMAGE }}:armv7-${{ env.TAG }}

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ RUN go mod download
1717
COPY . .
1818

1919
# Build the application
20-
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /newt
20+
ARG VERSION=dev
21+
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X main.newtVersion=${VERSION}" -o /newt
2122

2223
FROM public.ecr.aws/docker/library/alpine:3.23 AS runner
2324

0 commit comments

Comments
 (0)