Running Docker images from other architectures, on Linux

As I'd noted in Creating cross-compiled Docker images from Go binaries, I've been doing some work recently for container image builds.

As I'm putting the finishing touches to my talk at GopherCon UK for the end of this week, I'm creating a pre-built container to simplify setup.

However, to debug this issue with go install, I found that I needed to be able to run the cross-compiled ARM64 container on my AMD64 machine.

I found StereoLabs' blog post useful, and on top of it needed to install the right packages for me.

I found that on Arch Linux, I needed to:

# make sure qemu-user-static is installed
$ sudo pacman -S qemu-user-static{,-binfmt}
# not 100% sure if this is needed on top of the `-binfmt` package, but after I'd done these both, it all worked
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

You can then run:

% docker run --platform=linux/amd64 --rm -t golang:1.24 uname -a
Linux c464d56a0f62 6.15.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 02 Aug 2025 01:20:06 +0000 x86_64 GNU/Linux
% docker run --platform=linux/arm64 --rm -t golang:1.24 uname -a
Linux 74c62f138743 6.15.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 02 Aug 2025 01:20:06 +0000 aarch64 GNU/Linux

Written by Jamie Tanna's profile image Jamie Tanna on , and last updated on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

#blogumentation #docker #arch-linux.

This post was filed under articles.

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.