Skip to content

Commit b636402

Browse files
author
kongfang
committed
support build arm64 docker image
1 parent 2feedbd commit b636402

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
uses: docker/build-push-action@v4
3939
with:
4040
context: .
41+
platforms: linux/amd64,linux/arm64
4142
build-args: |
4243
KOMPANION_VERSION=${{ steps.get_tag.outputs.TAG }}
4344
push: true

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ WORKDIR /app
1414
ARG KOMPANION_VERSION=local
1515
ENV KOMPANION_VERSION=$KOMPANION_VERSION
1616

17-
RUN GOOS=linux GOARCH=amd64 \
17+
ARG TARGETARCH
18+
RUN GOOS=linux GOARCH=${TARGETARCH:-amd64} \
1819
go build -ldflags "-X main.Version=$KOMPANION_VERSION" -tags migrate -o /bin/app ./cmd/app
1920

21+
2022
# Step 3: Final
2123
FROM golang:1.22.5-alpine
2224
ENV GIN_MODE=release

0 commit comments

Comments
 (0)