Skip to content

Commit f733d91

Browse files
committed
ci: linux/amd64 and linux/arm64 multi platform image
Signed-off-by: Sertac Ozercan <[email protected]>
1 parent bb7a280 commit f733d91

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

kustomize.Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# Copyright 2022 The Kubernetes Authors.
22
# SPDX-License-Identifier: Apache-2.0
3+
ARG TARGETARCH TARGETOS
34

45
# build
5-
FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye as builder
6+
FROM --platform=${BUILDPLATFORM} public.ecr.aws/docker/library/golang:1.22.7-bullseye as builder
67
ARG VERSION
78
ARG COMMIT
89
ARG DATE
910
RUN mkdir /build
1011
ADD . /build/
1112
WORKDIR /build/kustomize
12-
RUN CGO_ENABLED=0 GO111MODULE=on go build \
13+
RUN CGO_ENABLED=0 GO111MODULE=on GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
1314
-ldflags="-s -X sigs.k8s.io/kustomize/api/provenance.version=${VERSION} \
1415
-X sigs.k8s.io/kustomize/api/provenance.buildDate=${DATE}"
1516

releasing/cloudbuild_kustomize_image.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ steps:
2929
COMMIT=$(git rev-parse HEAD)
3030
--build-arg
3131
DATE=$(date -u +%FT%TZ)
32+
--platform
33+
linux/amd64,linux/arm64
3234
.
3335
3436
images:

0 commit comments

Comments
 (0)