From 7f90ebfb3c4c69677bafa172fca08c6cbd5f85d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=A1l=20Gy=C3=B6rgy?= Date: Fri, 3 Jul 2026 22:34:07 +0200 Subject: [PATCH] build: cross-compile images from BUILDPLATFORM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pin the builder stage to the native build platform (FROM --platform=$BUILDPLATFORM) so multi-arch builds cross-compile via the already-parametrised GOARCH=$TARGETARCH instead of running the Go toolchain under QEMU emulation for the non-native architecture. Same resulting images, significantly faster multi-arch builds in CI. Signed-off-by: Gaál György --- Dockerfile | 2 +- checkpoint_merger.Dockerfile | 2 +- event_collector.Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 40e34e3f..ce962017 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.26 AS builder +FROM --platform=$BUILDPLATFORM golang:1.26 AS builder ARG TARGETOS ARG TARGETARCH ARG VERSION="dev" diff --git a/checkpoint_merger.Dockerfile b/checkpoint_merger.Dockerfile index 9600939e..2cad3ad0 100644 --- a/checkpoint_merger.Dockerfile +++ b/checkpoint_merger.Dockerfile @@ -1,5 +1,5 @@ # Build the checkpoint-merger binary -FROM golang:1.26 AS builder +FROM --platform=$BUILDPLATFORM golang:1.26 AS builder ARG TARGETOS ARG TARGETARCH ARG VERSION="dev" diff --git a/event_collector.Dockerfile b/event_collector.Dockerfile index b0620d0a..c1933f07 100644 --- a/event_collector.Dockerfile +++ b/event_collector.Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.26 AS builder +FROM --platform=$BUILDPLATFORM golang:1.26 AS builder ARG TARGETOS ARG TARGETARCH ARG VERSION="dev"