How to Rapidly Build Multi-Architecture Images with Buildx
December 8, 2025 · 1040 words · 5 min
Successfully running your container images on a variety of CPU architectures can be tricky. For exam
Successfully running your container images on a variety of CPU architectures can be tricky. For example, you might want to build your IoT application — running on an device like the Raspberry Pi — from a specific base image. However, Docker images typically support architectures by default. This scenario calls for a container image that supports multiple architectures, . Multi-architecture (multi-arch) images typically contain variants for different architectures and OSes. These images may also support CPU architectures like , , , and others. The magic of multi-arch images is that Docker automatically grabs the variant matching your OS and CPU pairing. While a regular container image has a manifest, a multi-architecture image has a manifest list. The list combines the manifests that show information about each variant’s size, architecture, and operating system. Multi-architecture images are beneficial when you want to run your container locally on your Linux machine, and remotely atop AWS Elastic Compute Cloud (EC2) . Additionally, it’s possible to build language-specific, multi-arch images — . Follow along as we learn about each component behind multi-arch image builds, then quickly create our image using and . You can build a multi-arch image by creating the individual images for each architecture, pushing them to Docker Hub, and entering to combine them within a tagged list. You can then push the manifest list to Docker Hub. This method is valid in some situations, but it can become tedious and relatively time consuming. However, you should only use the command in testing — not production. This command is experimental. We’re continually tweaking functionality and any associated UX while making production ready. However, two tools make it much easier to create multi-architectural builds: Docker Desktop and Docker Buildx. Docker Buildx enables you to complete every multi-architecture build step with one command via Docker Desktop. Before diving into the nitty gritty, let’s briefly examine some core Docker technologies. The is a text file containing all necessary instructions needed to assemble and deploy a container image with Docker. We’ll summarize the most common types of instructions, while contains information about others: Dockerfiles facilitate automated, multi-layer image builds based on your unique configurations. They’re relatively easy to create, and can grow to support images that require complex instructions. Dockerfiles are crucial inputs for image builds. Buildx leverages the command to build images from a and sets of files located at a specified or . Buildx comes packaged within Docker Desktop, and is a CLI plugin at its core. We consider it a plugin because it extends this base command with complete support for BuildKit’s feature set. We offer Buildx as a CLI command called , which you can use with Docker Desktop. In Linux environments, the command also works with the command on the terminal. Check out our Docker Buildx to learn more. is one core component within our framework, which is also open source. It’s an efficient build system that improves upon the original Docker Engine. For example, BuildKit lets you connect with remote repositories like , and offers better performance via caching. You don’t have to rebuild every image layer after making changes. While building a multi-arch image, BuildKit detects your specified architectures and triggers Docker Desktop to build and simulate those architectures. The command helps you tap into BuildKit. Docker Desktop is an application — built atop Docker Engine — that bundles together the Docker CLI, Docker Compose, Kubernetes, and related tools. You can use it to build, share, and manage containerized applications. Through the baked-in Docker Dashboard UI, Docker Desktop lets you tackle tasks with quick button clicks instead of manually entering intricate commands (though this is still possible). Docker Desktop’s QEMU emulation support lets you build and simulate multiple architectures in a single environment. It also enables building and testing on your macOS, Windows, and Linux machines. Now that you have working knowledge of each component, let’s hop into our walkthrough. Our tutorial requires the following: Let’s begin by building a basic Go application which prints text to your terminal. First, create a new folder called and move to it: Second, run the following command to track code changes in the application dependencies: Your terminal will output a similar response to the following: Third, create a new file and add the following code to it: This code created the function , which prints “Ready to learn!” at the web address. It also outputs the phrase to the terminal. Next, enter the command to run your application code in the terminal, which will produce the response. Since your app is ready, you can prepare a to handle the multi-architecture deployment of your Go application. Create a new file in the working directory and name it . Next, open that file and add in the following lines: Next, you’ll need to build your multi-arch image. This image is compatible with both the and server architectures. Since you’re using Buildx, BuildKit is also enabled by default. You won’t have to switch on this setting or enter any extra commands to leverage its functionality. The builder builds and provisions a container. It also packages the container for reuse. Additionally, Buildx supports multiple — which is pretty handy for creating scoped, isolated, and switchable environments for your image builds. Enter the following command to create a new builder, which we’ll call : You should get a terminal response that says . You can also view a list of builders using the command. You can even by entering . Now, you’ll jumpstart your multi-architecture build with the single command shown below: This does several things: Once your build is finished, your terminal will display the following: Next, navigate to the Docker Desktop and go to You’ll see your newly-created image via the Dashboard! Congratulations! You’ve successfully explored multi-architecture builds, step by step. You’ve seen how Docker Desktop, Buildx, BuildKit, and other tooling enable you to create and deploy multi-architecture images. While we’ve used a sample Go web application, you can apply these processes to other images and applications. To tackle your own projects, learn how to to build more multi-architecture images with Docker Desktop and Buildx. We’ve also outlined using Buildx.