Building Multi-Platform Docker Images with Buildx

Building Multi-Platform Docker Images with Buildx

Karthik Senthil Kumar

20 Nov 2025

Introduction

When working with Docker, most developers start with the classic docker build command. While it’s great for local development, it has one major limitation — the built image is tied to the architecture of the machine it was created on.
For instance, an image built on an amd64 system will only run seamlessly on amd64 architecture. But what if your application also needs to run on arm64 devices such as Apple Silicon Macs or ARM-based cloud servers?
That’s where Docker Buildx comes in.

Why Multi-Platform Images Matter

Modern applications need to run consistently across diverse environments. Without multi-architecture support, your containers may fail on certain systems.
Using Docker Buildx, you can easily create and publish multi-platform images (e.g., amd64 and arm64) to your container registry — ensuring your containers run anywhere, without modification.
Step-by-Step: How to Build Multi-Platform Images with Buildx
  1. Create a Private Repository on Docker Hub : Start by creating a new repository in your Docker Hub account where you’ll push the image.
  1. Log In to Docker Hub/Image Repository : In this blog, I’m using Docker Hub to store the image.
docker login
Enter your Docker Hub username and password when prompted.
  1. Create a Dockerfile: Inside your application’s source directory, create a Dockerfile that defines how the image should be built.
  1. Create a New Builder Instance: By default, Docker uses the Docker driver, which doesn’t support multi-platform builds. To enable this feature, create a new builder instance using the Docker container driver
docker buildx create –name container-builder –driver docker-container –bootstrap –use
You can replace container-builder with any preferred name.
  1. Build and Push the Multi-Platform Image : Now, build and push the image for both amd64 and arm64 platforms
docker buildx build –platform linux/amd64,linux/arm64 -t <REPOSITORY:TAG> –push .

Flags Explained:

  • –platform → specifies target architectures
  • -t → tags the image with name and version
  • –push → pushes the image directly to Docker Hub

References

With this setup, your Docker images will seamlessly run across Intel/AMD and ARM architectures, ensuring reliable deployments in any environment.