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?

It is actually in the docker cli reference:

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