Docker Buildx
Neil Haddley • March 1, 2021
Build multi-platform Docker images.
Buildx allows a developer to build for multiple architecture/operating systems.
When you invoke docker buildx build, you can set the --platform flag to specify the target platform for the build output, (for example, linux/amd64, linux/arm64, linux/arm/v7,linux/arm/v6, darwin/amd64).
The Dockerfile
Visual Studio Code is able to add a Dockerfile to the graphql-server project automagically.
I opened the Command Palette (⇧⌘P) and used the "Docker: Add Docker Files to Workspace..." command:
Uploading to Dockerhub
BASH
1$ docker login --username=haddley 2 3$ docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 --rm -t haddley/graphql-server:latest --push .
Docker playground
I added a new instance.
BASH
1docker run -d -p 5000:5000 haddley/graphql-server
Raspberry Pi
The docker image can be run on a Raspberry Pi.

















