diff --git a/kustomize.Dockerfile b/kustomize.Dockerfile index 66f59ee926..48fab6b0bc 100644 --- a/kustomize.Dockerfile +++ b/kustomize.Dockerfile @@ -1,15 +1,16 @@ # Copyright 2022 The Kubernetes Authors. # SPDX-License-Identifier: Apache-2.0 +ARG TARGETARCH TARGETOS # build -FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye as builder +FROM --platform=${BUILDPLATFORM} public.ecr.aws/docker/library/golang:1.22.7-bullseye as builder ARG VERSION ARG COMMIT ARG DATE RUN mkdir /build ADD . /build/ WORKDIR /build/kustomize -RUN CGO_ENABLED=0 GO111MODULE=on go build \ +RUN CGO_ENABLED=0 GO111MODULE=on GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \ -ldflags="-s -X sigs.k8s.io/kustomize/api/provenance.version=${VERSION} \ -X sigs.k8s.io/kustomize/api/provenance.buildDate=${DATE}" diff --git a/releasing/cloudbuild_kustomize_image.yaml b/releasing/cloudbuild_kustomize_image.yaml index 605b292171..3aa325f54a 100644 --- a/releasing/cloudbuild_kustomize_image.yaml +++ b/releasing/cloudbuild_kustomize_image.yaml @@ -29,6 +29,8 @@ steps: COMMIT=$(git rev-parse HEAD) --build-arg DATE=$(date -u +%FT%TZ) + --platform + linux/amd64,linux/arm64 . images: