Docker multiplatform build speed issue

Hello community,

As mutliplatform developers working primarily on macOS, me and my team use Docker for Linux development.
We have a docker image for our Linux dev environment, and a CI job to build it.
As this image is used on both ARM64 macOS for development and X86_64 Linux for CI/CD jobs, we need a multiplatform version of the image.

My problem is the following:

  • On macOS, using Docker Desktop, I enabled “Use containerd for pulling and storing images” and “Use Rosetta for x86_64/amd64 emulation on Apple Silicon”. Building the image manually with for either ARM64, AMD64 or both with the --platform option without any cache takes only a few minutes.
  • On my Linux CI workers, powerful computers running Docker workers, building the Intel-only image with Docker-in-Docker is also really fast (a few minutes), but building the multiplatform image with a buildx context and the --platform=linux/amd64,linux/arm64 option takes litteraly hours.

Is there something am I missing here, or is multiplatform image building really slow on Linux and there is nothing we can do about it?

Thank you for your help :pray:

Thomas

1 Like