Skip to content

Commit

Permalink
ci: linux/amd64 and linux/arm64 multi platform image
Browse files Browse the repository at this point in the history
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
  • Loading branch information
sozercan committed Nov 8, 2024
1 parent bb7a280 commit f733d91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kustomize.Dockerfile
Original file line number Diff line number Diff line change
@@ -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}"

Expand Down
2 changes: 2 additions & 0 deletions releasing/cloudbuild_kustomize_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ steps:
COMMIT=$(git rev-parse HEAD)
--build-arg
DATE=$(date -u +%FT%TZ)
--platform
linux/amd64,linux/arm64
.
images:
Expand Down

0 comments on commit f733d91

Please # to comment.