Transparently running binaries from any architecture in Linux

we can use binfmt_misc to set up our own interpreters. Now we have all the pieces and we want to put them together. We need to setup binfmt_misc in order to use QEMU user mode as an interpreter for our binary format. - Own your bits

Now that we have that covered, nothing prevents us from applying that to Docker containers. - Running ARM containers

Running ARM programs under linux

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

# armel packages also exist
$ sudo apt-get install gcc-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user-static

Usage

$ cat > hello.c << EOF

#include <stdio.h>
int main(void) { return printf("Hello ARM!\n"); }
EOF

$ arm-linux-gnueabihf-gcc -static  -ohello hello.c

$ file hello
hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked,

$ ./hello
Hello ARM!
Written on March 20, 2021, Last update on April 30, 2021
arm emulator