Skip to content

Commit 290aed3

Browse files
committed
fix(build): inject version into container build
1 parent 2aa09ad commit 290aed3

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

.github/workflows/build.yml

+2
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ jobs:
132132
tags: ${{ steps.meta.outputs.tags }}
133133
labels: ${{ steps.meta.outputs.labels }}
134134
push: ${{ github.ref_protected }}
135+
build-args: |
136+
VERSION=v${{ steps.semantic.outputs.release-version }}
135137
136138
auto-merge:
137139
name: Auto-merge

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ docker:
4545
docker build \
4646
-t k3se:latest \
4747
-t k3se:$(VERSION) \
48+
--build-arg VERSION=$(VERSION) \
4849
-f build/package/Dockerfile .
4950

5051
.PHONY: clean

build/package/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ RUN go mod download
88

99
# Copy source files and build application.
1010
COPY . /app
11-
RUN make && mv bin/* /app/bin/k3se
11+
ARG VERSION
12+
RUN VERSION=${VERSION} make -B && mv bin/* /app/bin/k3se
1213

1314
# Create minimal container image.
1415
FROM gcr.io/distroless/base:nonroot AS run

0 commit comments

Comments
 (0)