From 0a83f2457fe281d1560dbeaf6b98d4db9e1efc57 Mon Sep 17 00:00:00 2001 From: Ciprian Hacman Date: Thu, 11 Sep 2025 14:50:43 +0300 Subject: [PATCH] Use cross-compile for Docker builds --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f15d83de..247e437e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,14 +20,14 @@ # directly replaced. See here, and note that "stage" parameter mentioned there has been renamed to # "build-context": https://github.com/docker/buildx/pull/904#issuecomment-1005871838 FROM golang:1.24.6-bookworm@sha256:bdc7cfd953b2701fcd95fd591ea3d788f41e4b74f21f1787b9f9843a28e72196 AS builder-base -FROM builder-base AS builder +FROM --platform=$BUILDPLATFORM builder-base AS builder ARG TARGETARCH ENV GOPATH=/gopath/ ENV PATH=$GOPATH/bin:$PATH -RUN apt-get update --fix-missing && apt-get --yes install libsystemd-dev gcc-aarch64-linux-gnu +RUN apt-get update --fix-missing && apt-get --yes install libsystemd-dev RUN go version COPY . /gopath/src/k8s.io/node-problem-detector/