From cec01ec77dd7769a588477b5c5f1e36665abd11b Mon Sep 17 00:00:00 2001 From: Jesus Uriel Guzman-Mendoza Date: Wed, 6 Nov 2024 22:41:22 +0000 Subject: [PATCH] Add platform flag to Golang binary to honor build platform --- cmd/csi_driver/Dockerfile | 2 +- cmd/sidecar_mounter/Dockerfile | 2 +- cmd/webhook/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/csi_driver/Dockerfile b/cmd/csi_driver/Dockerfile index f96707018..062fd870c 100644 --- a/cmd/csi_driver/Dockerfile +++ b/cmd/csi_driver/Dockerfile @@ -14,7 +14,7 @@ # limitations under the License. # Build driver go binary -FROM golang:1.22.7 AS driver-builder +FROM --platform=$BUILDPLATFORM golang:1.22.7 AS driver-builder ARG STAGINGVERSION diff --git a/cmd/sidecar_mounter/Dockerfile b/cmd/sidecar_mounter/Dockerfile index 9e26fafac..37769cbb4 100644 --- a/cmd/sidecar_mounter/Dockerfile +++ b/cmd/sidecar_mounter/Dockerfile @@ -14,7 +14,7 @@ # limitations under the License. # Build sidecar-mounter go binary -FROM golang:1.22.7 AS sidecar-mounter-builder +FROM --platform=$BUILDPLATFORM golang:1.22.7 AS sidecar-mounter-builder ARG STAGINGVERSION diff --git a/cmd/webhook/Dockerfile b/cmd/webhook/Dockerfile index bf200e2a7..564d3034d 100644 --- a/cmd/webhook/Dockerfile +++ b/cmd/webhook/Dockerfile @@ -14,7 +14,7 @@ # limitations under the License. # Build webhook go binary -FROM golang:1.22.7 AS webhook-builder +FROM --platform=$BUILDPLATFORM golang:1.22.7 AS webhook-builder ARG STAGINGVERSION