From 400036409f3267fed63bb60335785cfecaf3f960 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Wed, 15 Nov 2023 16:21:02 +0800 Subject: [PATCH 1/5] draft --- sonic-slave-bullseye/Dockerfile.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index 19e1babc3952..407ab6548e78 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -6,6 +6,8 @@ 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-6.1.0-8 as qemu FROM {{ prefix }}multiarch/debian-debootstrap:arm64-bullseye +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131 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-6.1.0-8 as qemu From 06c361c5abd96a2ab7cc1d7aa1e5ab0ebe40d86e Mon Sep 17 00:00:00 2001 From: shilongliu Date: Wed, 15 Nov 2023 17:02:37 +0800 Subject: [PATCH 2/5] fix --- sonic-slave-bullseye/Dockerfile.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index 407ab6548e78..8f9b493fe3b0 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -6,6 +6,7 @@ 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-6.1.0-8 as qemu FROM {{ prefix }}multiarch/debian-debootstrap:arm64-bullseye +RUN apt-get update || apt-get install -y gnupg RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131 COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin From 4557d85a874f94162b824388eb3ac2c240ba2983 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Wed, 15 Nov 2023 17:10:14 +0800 Subject: [PATCH 3/5] fix --- sonic-slave-bullseye/Dockerfile.j2 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index 8f9b493fe3b0..9a017ecfc037 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -6,9 +6,6 @@ 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-6.1.0-8 as qemu FROM {{ prefix }}multiarch/debian-debootstrap:arm64-bullseye -RUN apt-get update || apt-get install -y gnupg -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131 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-6.1.0-8 as qemu @@ -42,6 +39,14 @@ ARG PYTHON_CROSS_PLATFORM=linux_aarch64 {%- endif %} RUN dpkg --add-architecture $arch + +{%- if CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} +# multiarch/debian-debootstrap:arm64-bullseye is too old. It needs to install keys +RUN apt-get update || apt-get install -y gnupg +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131 +{%- endif %} + RUN apt-get update && apt-get install -y eatmydata RUN eatmydata apt-get install -y crossbuild-essential-$arch RUN eatmydata apt-get install -y gcc-$gcc_arch From 0895eb373738e3e12b23443abea4c175b8516146 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Wed, 15 Nov 2023 17:51:49 +0800 Subject: [PATCH 4/5] fix --- sonic-slave-bullseye/Dockerfile.j2 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index 9a017ecfc037..8314a7ee8885 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -40,13 +40,6 @@ ARG PYTHON_CROSS_PLATFORM=linux_aarch64 RUN dpkg --add-architecture $arch -{%- if CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -# multiarch/debian-debootstrap:arm64-bullseye is too old. It needs to install keys -RUN apt-get update || apt-get install -y gnupg -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131 -{%- endif %} - RUN apt-get update && apt-get install -y eatmydata RUN eatmydata apt-get install -y crossbuild-essential-$arch RUN eatmydata apt-get install -y gcc-$gcc_arch @@ -88,6 +81,13 @@ RUN PATH=/python_virtualenv/env3/bin/:$PATH python3 -m pip uninstall -y enum34 RUN PATH=/python_virtualenv/env3/bin/:$PATH pip3 install --force-reinstall --no-cache-dir coverage {%- endif %} +{%- if CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} +# multiarch/debian-debootstrap:arm64-bullseye is too old. It needs to install keys +RUN apt-get update || apt-get install -y gnupg +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131 +{%- endif %} + RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install -y \ apt-utils \ default-jre-headless \ From 029badc64e7d186291bf8538378e0a680a57ae20 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Wed, 15 Nov 2023 17:54:36 +0800 Subject: [PATCH 5/5] fix --- sonic-slave-bullseye/Dockerfile.j2 | 1 - 1 file changed, 1 deletion(-) diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index 8314a7ee8885..7bcf438cca82 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -39,7 +39,6 @@ ARG PYTHON_CROSS_PLATFORM=linux_aarch64 {%- endif %} RUN dpkg --add-architecture $arch - RUN apt-get update && apt-get install -y eatmydata RUN eatmydata apt-get install -y crossbuild-essential-$arch RUN eatmydata apt-get install -y gcc-$gcc_arch