From 9df5ffec74674413835a0de5a38ab6417c8952b7 Mon Sep 17 00:00:00 2001 From: k2safe Date: Mon, 2 Nov 2026 15:34:28 +0800 Subject: [PATCH] fix: honor the requested architecture when compiling container binaries --- Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7150b0a..d70cdcb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ -ARG TARGETOS=linux -ARG TARGETARCH=amd64 - -FROM registry.cn-shenzhen.aliyuncs.com/yuntuo_tools/golang:1.27.1-alpine AS build +# The pinned compiler image is amd64; Go cross-compiles each target selected by BuildKit. +FROM --platform=linux/amd64 registry.cn-shenzhen.aliyuncs.com/yuntuo_tools/golang:1.27.1-alpine@sha256:81b9f1f3d11530b7609dd3e9dd0dbd383511dd605dce7e25b37c39da19998bb9 AS build ARG TARGETOS ARG TARGETARCH