From 00fa56760f97e051c73655bd316a281a7d5e96ea Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Tue, 16 Jan 2024 18:27:06 -0800 Subject: [PATCH] Fix building the SONiC slave container for QEMU-based build (#17571) Why I did it The existing source of multiarch/debian-debootstrap doesn't appear to have Bookworm-based images available. Because of this, slave containers for cross-compilation of SONiC (with QEMU) cannot be built. Work item tracking Microsoft ADO (number only): 26214341 How I did it Since those images don't do anything to the Debian container besides add QEMU to it (which we overwrite anyways with the latest version of QEMU available from multiarch/qemu-user-static, just take the platform-specific version of the official Debian image and add QEMU to it. How to verify it --- sonic-slave-bookworm/Dockerfile.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonic-slave-bookworm/Dockerfile.j2 b/sonic-slave-bookworm/Dockerfile.j2 index 60f3c0b9811d..6bf09c425cd1 100644 --- a/sonic-slave-bookworm/Dockerfile.j2 +++ b/sonic-slave-bookworm/Dockerfile.j2 @@ -1,11 +1,11 @@ {% set prefix = DEFAULT_CONTAINER_REGISTRY %} {%- if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} FROM {{ prefix }}multiarch/qemu-user-static:x86_64-arm-7.2.0-1 as qemu -FROM {{ prefix }}multiarch/debian-debootstrap:armhf-bookworm +FROM --platform=linux/arm/v7 {{ prefix }}debian:bookworm COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin {%- elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} FROM {{ prefix }}multiarch/qemu-user-static:x86_64-aarch64-7.2.0-1 as qemu -FROM {{ prefix }}multiarch/debian-debootstrap:arm64-bookworm +FROM --platform=linux/arm64 {{ prefix }}debian:bookworm COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin {%- elif CONFIGURED_ARCH == "armhf" and CROSS_BUILD_ENVIRON == "y" %} FROM {{ prefix }}multiarch/qemu-user-static:x86_64-arm-7.2.0-1 as qemu