From 440181cda8d9829e6e499eb0d52a1d7aea4442f2 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Mon, 1 Apr 2024 08:23:43 -0400 Subject: [PATCH] assemble arm64 image in amd64 container 1. In order to support qemu-binfmt with non-native chroot, install qemu-user-static on host rather than in container On debian 12 host, after install qemu-user-static $ cat /proc/sys/fs/binfmt_misc/qemu-aarch64 enabled interpreter /usr/libexec/qemu-binfmt/aarch64-binfmt-P flags: POCF offset 0 magic 7f454c460201010000000000000000000200b700 mask ffffffffffffff00fffffffffffffffffeffffff On an amd64 host: $ debootstrap --arch=arm64 buster buster-chroot http://deb.debian.org/debian ... $ chroot buster-chroot /bin/bash See https://issues.guix.gnu.org/36117 for detail 2. Install arch-test in container unconditionally which is required by mmdebstrap root@0fb7bae77452:/usr/src/config/uefi-arm64-ostree# ruck build --config image.yaml ... 2024-04-01 12:30:49,605 Running mmdebstrap. I: automatically chosen mode: root E: install arch-test for foreign architecture support Signed-off-by: Hongxu Jia --- docker/Dockerfile | 3 +-- tools/build-container.sh | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index c500d59..ae1bb6f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -4,6 +4,7 @@ FROM debian:testing # hadolint ignore=DL3008 RUN apt-get update && \ apt-get install -y --no-install-recommends \ + arch-test \ mmdebstrap \ bubblewrap \ dosfstools \ @@ -32,8 +33,6 @@ RUN apt-get update && \ git && \ rm -rf /var/lib/apt/lists/* -RUN if [ "$(uname -m)" = "x86_64" ]; then apt update && apt install qemu-user-static arch-test -y; fi - COPY files/pip.conf /etc/pip.conf RUN pip install omegaconf diff --git a/tools/build-container.sh b/tools/build-container.sh index 2809fff..034916c 100755 --- a/tools/build-container.sh +++ b/tools/build-container.sh @@ -1,3 +1,7 @@ #!/bin/bash +# qemu-binfmt with non-native chroot +sudo apt update +sudo apt install qemu-user-static -y + docker build -t ruck docker