Skip to content

Commit

Permalink
Fix building the SONiC slave container for QEMU-based build (sonic-ne…
Browse files Browse the repository at this point in the history
…t#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
  • Loading branch information
saiarcot895 authored Jan 17, 2024
1 parent 9f18587 commit 00fa567
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sonic-slave-bookworm/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 00fa567

Please sign in to comment.