From 2b642594c65b2152e1808db5aebf12c60c8deaa1 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Sat, 10 Oct 2020 14:50:14 +0800 Subject: [PATCH] [feature] enable building ARM image on x86 --- apps/docker-arm.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 apps/docker-arm.sh diff --git a/apps/docker-arm.sh b/apps/docker-arm.sh new file mode 100755 index 0000000..432dc83 --- /dev/null +++ b/apps/docker-arm.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +DIR=$(readlink -f $(dirname $0)) +. $DIR/../env.sh + + +# let docker be able to build arm image on x86 +if ! docker run --rm -t arm64v8/ubuntu uname -m; then + case "$PM" in + apt) + sudo apt-get install qemu binfmt-support qemu-user-static + ;; + pacman) + # TODO + ;; + esac + sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + sudo docker run --rm -t arm64v8/ubuntu uname -m +fi +