File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,22 @@ BUILDS="${1}"
2424# Generally blank, but will be set to "redhat" for Konflux builds
2525BUILD_SUFFIX=" ${2:- " " } "
2626
27+ # When building multi-arch images, only the linux/amd64 build needs to cross-compile all platform/arch combinations for download.
28+ # The other platforms only need their native binary. This reduces builds from 28 (7 binaries × 4 platforms) to 10 (7 + 1 + 1 + 1).
29+
30+ # Check if TARGETOS and TARGETARCH are set (Dockerfile sets these via buildah --platform)
31+ if [[ -n " ${TARGETOS:- } " && -n " ${TARGETARCH:- } " ]]; then
32+ # We're in a Dockerfile build with TARGETOS/TARGETARCH set
33+ if [[ " ${TARGETOS} " == " linux" && " ${TARGETARCH} " == " amd64" ]]; then
34+ # amd64 builds ALL binaries for download availability
35+ echo " Platform linux/amd64: Building all cross-compiled binaries for download"
36+ else
37+ # Other platforms only build their native binary
38+ echo " Platform ${TARGETOS} /${TARGETARCH} : Building only native binary"
39+ BUILDS=" ${TARGETOS} _${TARGETARCH} "
40+ fi
41+ fi
42+
2743EC_FULL_VERSION=$( hack/derive-version.sh " ${BUILD_SUFFIX} " )
2844
2945echo " EC_FULL_VERSION=$EC_FULL_VERSION "
You can’t perform that action at this time.
0 commit comments