Build Multi-Platform Docker Images with Docker Buildx
Intro I developed a Node.js application and wanted to run it on a Raspberry Pi in a Docker container. I built a Docker image on my x64 laptop (Ubuntu) and pushed it to Docker Hub. On the Raspberry Pi, I pulled the image and tried to run the container — but it failed with exit code 139. Problem By default, docker build creates an image for the architecture of the machine you build on. In my case, I produced an amd64 image on an amd64 machine. A Raspberry Pi 3 Model B typically runs a 32‑bit OS, so it expects linux/arm/v7 (armhf). It will only use linux/arm64 if you run a 64‑bit OS. The architecture mismatch caused the runtime error. ...