Docker Community Forums

Share and learn in the Docker community.

Run x86 (Intel) and ARM based images on Apple Silicon (M1) Macs?

For my home network, I am looking at a new server unit, to run the various containers and other things. My previous setup used a Ubuntu x86 instance. I know the majority of the images I use are x86 based and have not really looked much into the ARM world. Until now…

Being an Apple customer, I am wondering if use a Mac Mini M1, do ALL Docker images run as expected? Does this happen via the Rosetta 2 framework? Or some other abstraction layer? What, if anything, needs to change? Can you dual-run the Intel and M1 versions of Docker Desktop on the same unit?

You can run ARM or Intel Docker containers on the Apple M1 Mac with Docker Desktop for Mac M1. I do it all the time. The default, of course, is to run the ARM version but if you use the --platform linux/amd64 parameter Docker will run the Intel version for you.

You can try it with one of my images that I’ve built to run Vagrant with Docker as a provider on Apple M1 Silicon:

docker run --rm -it --platform linux/amd64 rofrano/vagrant-provider:debian bash

That will drop you into a bash shell in an amd64 container.

# uname -a
Linux 694817f598fe 5.10.47-linuxkit #1 SMP PREEMPT Sat Jul 3 21:50:16 UTC 2021 x86_64 GNU/Linux

BTW, I absolutely love my M1 Mac mini for development work. It is blazing fast! I highly recommend getting one.

If you want more info on how I built that image I documented it in this article:
Developing on Apple M1 Silicon with Virtual Environments

Hope that helps.