How to run amd64 docker image on arm64 host platform?

Using --platform is correct. On my M1 Mac I’m able to run both arm64 and amd64 versions of the Ubuntu image from Docker Hub. The machine hardware name provided by uname proves it.

# docker run --rm -ti --platform linux/arm/v7 ubuntu:latest uname -m
armv7l

# docker run --rm -ti --platform linux/amd64 ubuntu:latest uname -m
x86_64

Running amd64 images is enabled by Rosetta2 emulation, as indicated here.

Not all images are available for ARM64 architecture. You can add --platform linux/amd64 to run an Intel image under emulation.

If the container is exiting immediately, that’s a problem with the specific container you’re using.

Leave a Comment