16 Building Docker images that run anywhere: Linux, Windows, Intel, and Arm

 

There are dozens of try-it-now exercises in this book, and if you’ve used different machines to follow along, you’ll have seen that the exercises work in the same way on Mac, Windows, Linux, and Raspberry Pi. That’s not an accident--I’ve built every Docker image in this book as a multi-architecture image. Multi-arch images are built and pushed to registries with multiple variants, each targeting a different operating system or CPU architecture, but all using the same image name. When you use one of these images to run a container or to build another image, Docker pulls the matching variant for the CPU and OS on your machine. If you use the same image name on a different architecture, you’ll get a different image variant, but it will be the same app and it will work in the same way. It’s a super-easy workflow for the user, but it takes some effort for the image publisher.

In this chapter you’ll learn the different ways to produce multi-arch builds, but if you’re thinking of skipping this one because you don’t use Windows or Arm, you should at least read the first section to learn why this is a game-changing option.

16.1 Why multi-architecture images are important

16.2 Building multi-arch images from one or more Dockerfiles

16.3 Pushing multi-arch images to registries with manifests

16.4 Building multi-arch images with Docker Buildx

16.5 Understanding where multi-arch images fit in your roadmap

16.6 Lab

sitemap