Running Docker Container with emulated Architecture

Posted . Visible to the public.

You can use docker to run images with a different architecture using qemu emulation.

Prerequisites

There are a couple required packages for ubuntu which you can install with apt:

sudo apt install qemu binfmt-support qemu-user-static

or follow the docker documentation Show archive.org snapshot and use a docker image to install the requirements.

Running Images

Just use the --platform option with the architecture you want to use when starting an image:

docker run --rm --platform linux/arm64 alpine uname -a

Check registered executable types

Checking if F is among the flags in /proc/sys/fs/binfmt_misc/qemu-* : cat /proc/sys/fs/binfmt_misc/qemu-*

Ruben Aleman
Last edit
Ruben Aleman
License
Source code in this card is licensed under the MIT License.