Difficulty: beginner
Estimated Time: 10 minutes

Build PowerPC LE (ppc64le) arch Docker Image on Intel

You can read more details in the related article - https://goo.gl/eU0Qbj

This scenario describes how to build a Docker Image for a specific archtiecture (say PowerPC LE) on a system with different CPU architecture (Intel)

Don’t stop now! The next scenario will only take about 10 minutes to complete.

Building Multi-arch Docker Images on Intel Host

Step 1 of 3

Step 1 - Setup Environment

Register Qemu as PowerPC LE binary handler. This leverages binfmt_misc capability of the Linux kernel and is the key thing. More details on binfmt_misc is available here

Check the host CPU architecture.

uname -m

The command below will register interpreters to run binaries belonging to specific architecture.

docker run --rm --privileged multiarch/qemu-user-static:register

Verify.

cat /proc/sys/fs/binfmt_misc/ppc64le

Any ppc64le binary (magic - 7f454c460....) will be executed with /usr/bin/qemu-ppc64le-static.