DOCKER_DEFAULT_PLATFORM should be more obvious to Apple silicon users (/everyone!)

Since M1s came out, we’ve struggled with finding Apple-silicon-compatible images and swapping them in correctly. Messy and time-consuming!

Fast forward a while, and we found DOCKER_DEFAULT_PLATFORM:

export DOCKER_DEFAULT_PLATFORM=linux/amd64

That has been a silver bullet across all of our projects we’ve had trouble with in the past.

It’s nowhere to be found in:

  • Install Docker Desktop on Mac
  • Docker Desktop for Apple silicon
  • Docker Desktop for Mac release notes
  • Logs and troubleshooting
  • FAQs

Why isn’t this more obvious somewhere? Or is it and we somehow missed it?

1 Like

It is actually in the docker cli reference:

DOCKER_DEFAULT_PLATFORM Default platform for commands that take the --platform flag.

Having wasted a day trying to debug issues with running an x86 Docker image on my Apple M1 Mac, I agree with OP that it should be much more obvious to use DOCKER_DEFAULT_PLATFORM and Rosetta 2. It’s not enough to have this only mentioned in the Docker CLI command description and usage because the CLI documentation is the last place someone is going to think to look if they have a Mac specific issue. I think there should be an explicit guide for running x86 images on Apple chip Mac, linked in the Install Docker Desktop on Mac at the very least.

Unfortunately, this now causes us unnecessary problems with issues from users because correct multi-arch images now fail because rosetta seems to be incompatible with read-only deployments. This is no silver bullet, it causes more and more false positives.