From a6ab4661c3932cfa4174dec2ec039e519872445d Mon Sep 17 00:00:00 2001 From: jared Date: Wed, 23 Dec 2020 00:26:17 +0800 Subject: [PATCH] Build multiplatform images when issue `make release-images` Signed-off-by: jared --- build/lib/release.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/lib/release.sh b/build/lib/release.sh index 6b3d45dfbb04..b97b12f6d088 100644 --- a/build/lib/release.sh +++ b/build/lib/release.sh @@ -383,7 +383,11 @@ EOF echo "COPY nsswitch.conf /etc/" >> "${docker_file_path}" fi - "${DOCKER[@]}" build ${docker_build_opts:+"${docker_build_opts}"} -q -t "${docker_image_tag}" "${docker_build_path}" >/dev/null + if [[ "${arch}" == "linux/s390x" || "${arch}" == "linux/ppc64le" ]]; then + DOCKER_CLI_EXPERIMENTAL=enabled "${DOCKER[@]}" buildx build --platform linux/"${arch}" --load ${docker_build_opts:+"${docker_build_opts}"} -q -t "${docker_image_tag}" "${docker_build_path}" >/dev/null + else + "${DOCKER[@]}" build ${docker_build_opts:+"${docker_build_opts}"} -q -t "${docker_image_tag}" "${docker_build_path}" >/dev/null + fi # If we are building an official/alpha/beta release we want to keep # docker images and tag them appropriately. local -r release_docker_image_tag="${KUBE_DOCKER_REGISTRY-$docker_registry}/${binary_name}-${arch}:${KUBE_DOCKER_IMAGE_TAG-$docker_tag}"