Note: Docker for Mac uses QEMU to virtualise (or emulate?) an amd64 host when running amd64 containers. However, if there's a service which uses a base image that's only available for amd64, or there are some old dependencies which are only available for amd64, or the service won't run in an arm64 container for some reason, then you'll need to specify the target platform for this particular service.
Note: the normalization for the "platform specifier" ( amd64, arm64, etc) is defined in the code for containerd. If you're lucky, you can run docker-compose build, then docker-compose up, and everything will be fine - it'll pull linux/arm64 base images, install arm64 packages using the package manager of the operating system in the container, build your image and run the service with no problems. Imagine you've got a new Macbook with an ARM-based processor (Apple M1), and you're trying to build a collection of services defined in a docker-compose.yml file.Įach service definition has a build property which points to a folder containing a Dockerfile. For more precision, use docker buildx bake to build each image for a specific architecture. MaTLDR: In general, setting DOCKER_DEFAULT_PLATFORM=linux/amd64 will tell Docker to build amd64 images.