Skip to content

Commit 4848f62

Browse files
committed
wip
1 parent 800ffc6 commit 4848f62

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ jobs:
2424
with:
2525
persist-credentials: false
2626

27+
- name: Set up QEMU
28+
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
29+
with:
30+
platforms: linux/amd64,linux/arm64
31+
32+
- name: Set up Docker Buildx
33+
uses: docker/setup-buildx-action@3d68780484996aa9d417bb9016193885cdf1f299
34+
2735
- name: Log in to the Container registry
2836
uses: docker/login-action@06fb636fac595d6fb4b28a5dfcb21a6f5091859c
2937
with:
@@ -41,6 +49,7 @@ jobs:
4149
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a
4250
with:
4351
context: .
52+
platforms: linux/amd64,linux/arm64
4453
push: true
4554
tags: ${{ steps.meta.outputs.tags }}
4655
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.26.5-alpine AS builder
1+
FROM --platform=$BUILDPLATFORM golang:1.26.5-alpine AS builder
22

33
WORKDIR /src
44

@@ -12,8 +12,9 @@ RUN go mod download
1212
# Copy source code
1313
COPY . .
1414

15-
# Build the binary
16-
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /proxy ./cmd/proxy
15+
# Build the binary for the target platform
16+
ARG TARGETARCH
17+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -ldflags="-s -w" -o /proxy ./cmd/proxy
1718

1819
FROM alpine:3.24.1
1920

0 commit comments

Comments
 (0)