From 4848f62886cb5430005d3f56cf617afbd4c809da Mon Sep 17 00:00:00 2001 From: Ondrej Kokes Date: Thu, 6 Aug 2026 13:39:57 +0200 Subject: [PATCH 1/4] wip --- .github/workflows/publish.yml | 9 +++++++++ Dockerfile | 7 ++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c08cfa6..ca47787 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,6 +24,14 @@ jobs: with: persist-credentials: false + - name: Set up QEMU + uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf + with: + platforms: linux/amd64,linux/arm64 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@3d68780484996aa9d417bb9016193885cdf1f299 + - name: Log in to the Container registry uses: docker/login-action@06fb636fac595d6fb4b28a5dfcb21a6f5091859c with: @@ -41,6 +49,7 @@ jobs: uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a with: context: . + platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index c2e197f..9c51d30 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.26.5-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:1.26.5-alpine AS builder WORKDIR /src @@ -12,8 +12,9 @@ RUN go mod download # Copy source code COPY . . -# Build the binary -RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /proxy ./cmd/proxy +# Build the binary for the target platform +ARG TARGETARCH +RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -ldflags="-s -w" -o /proxy ./cmd/proxy FROM alpine:3.24.1 From 328db8a4ee1c30b68c4f6480e0d2d52f7c8ee44a Mon Sep 17 00:00:00 2001 From: Ondrej Kokes Date: Thu, 6 Aug 2026 13:42:27 +0200 Subject: [PATCH 2/4] pin to latest version, not commit --- .github/workflows/publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ca47787..fd46e03 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,12 +25,12 @@ jobs: persist-credentials: false - name: Set up QEMU - uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf + uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0 with: platforms: linux/amd64,linux/arm64 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@3d68780484996aa9d417bb9016193885cdf1f299 + uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 - name: Log in to the Container registry uses: docker/login-action@06fb636fac595d6fb4b28a5dfcb21a6f5091859c From 355e8f867e1481db36327974ad94063d4be591cd Mon Sep 17 00:00:00 2001 From: Ondrej Kokes Date: Thu, 6 Aug 2026 13:43:12 +0200 Subject: [PATCH 3/4] test run --- .github/workflows/publish.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fd46e03..1ca8e5c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,8 +3,8 @@ name: Publish Docker image on: workflow_dispatch: push: - tags: - - "v*" + # tags: + # - "v*" permissions: {} @@ -32,24 +32,24 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 - - name: Log in to the Container registry - uses: docker/login-action@06fb636fac595d6fb4b28a5dfcb21a6f5091859c - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + # - name: Log in to the Container registry + # uses: docker/login-action@06fb636fac595d6fb4b28a5dfcb21a6f5091859c + # with: + # registry: ghcr.io + # username: ${{ github.actor }} + # password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 - with: - images: ghcr.io/${{ github.repository }} + # - name: Extract metadata (tags, labels) for Docker + # id: meta + # uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 + # with: + # images: ghcr.io/${{ github.repository }} - name: Build and push Docker image uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a with: context: . platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + push: false + # tags: ${{ steps.meta.outputs.tags }} + # labels: ${{ steps.meta.outputs.labels }} From 02519df215a72eb68308c745a5d672a2a4155c3a Mon Sep 17 00:00:00 2001 From: Ondrej Kokes Date: Thu, 6 Aug 2026 13:48:29 +0200 Subject: [PATCH 4/4] Revert "test run" This reverts commit 355e8f867e1481db36327974ad94063d4be591cd. --- .github/workflows/publish.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1ca8e5c..fd46e03 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,8 +3,8 @@ name: Publish Docker image on: workflow_dispatch: push: - # tags: - # - "v*" + tags: + - "v*" permissions: {} @@ -32,24 +32,24 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 - # - name: Log in to the Container registry - # uses: docker/login-action@06fb636fac595d6fb4b28a5dfcb21a6f5091859c - # with: - # registry: ghcr.io - # username: ${{ github.actor }} - # password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to the Container registry + uses: docker/login-action@06fb636fac595d6fb4b28a5dfcb21a6f5091859c + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - # - name: Extract metadata (tags, labels) for Docker - # id: meta - # uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 - # with: - # images: ghcr.io/${{ github.repository }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 + with: + images: ghcr.io/${{ github.repository }} - name: Build and push Docker image uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a with: context: . platforms: linux/amd64,linux/arm64 - push: false - # tags: ${{ steps.meta.outputs.tags }} - # labels: ${{ steps.meta.outputs.labels }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}