Multi-Arch Image

Multi-Arch Image

Image only work on a single platform

But containers are supported on multiple architectures and operating systems

Virtual images to the rescue

Manifest links to multiple images for supported platforms

Now integrated in Docker CLI (docker manifest)

Based on manifest-tool (by Docker Captain Phil Estes)

Official images are already multi-arch

Multi-Arch Image: openjdk

$ docker run mplatform/mquery openjdk:8-jdk
Image: openjdk:8-jdk
* Manifest List: Yes
* Supported platforms:
- linux/amd64
- windows/amd64:10.0.17763.805
- windows/amd64:10.0.17134.1069
- windows/amd64:10.0.14393.3274
$ docker run mplatform/mquery openjdk:8-jdk-nanoserver
Image: openjdk:8-jdk-nanoserver
* Manifest List: Yes
* Supported platforms:
- windows/amd64:10.0.17763.802
- windows/amd64:10.0.17134.1069

Multi-Arch Image: hello-world

$ docker run mplatform/mquery hello-world
Image: hello-world
* Manifest List: Yes
* Supported platforms:
- linux/amd64
- linux/arm/v5
- linux/arm/v7
- linux/arm64
- linux/386
- linux/ppc64le
- linux/s390x
- windows/amd64:10.0.17134.1069
- windows/amd64:10.0.17763.802

Multi-Arch Image: docker

$ docker run mplatform/mquery docker
Image: docker
* Manifest List: Yes
* Supported platforms:
- linux/amd64
- linux/arm/v6
- linux/arm/v7
- linux/arm64

Demo: Building for other Architectures

Prepare for new sub command buildx

Enable experimental mode for client and enable qemu:

docker run --rm --privileged \

Create builder:

docker buildx create --name mybuilder --use
docker buildx inspect --bootstrap

Demo: Building for other Architectures

Build multi-arch:

docker buildx build \
    --platform linux/arm,linux/arm64,linux/amd64 \
    --tag localhost:5000/nicholasdille/hello \
    . \

Inspect result:

docker buildx imagetools inspect \

Demo: Build multi-arch with proper tags (1)

Build individual images to control tagging

Build for arm, arm64 and amd64:

docker buildx build --platform linux/arm \
    --tag localhost:5000/nicholasdille/hello:arm . --push
docker buildx build --platform linux/arm64 \
    --tag localhost:5000/nicholasdille/hello:arm64 . --push
docker buildx build --platform linux/amd64 \
    --tag localhost:5000/nicholasdille/hello:amd64 . --push

Test new images:

docker run localhost:5000/nicholasdille/hello:arm
docker run localhost:5000/nicholasdille/hello:arm64
docker run localhost:5000/nicholasdille/hello:amd64

This allows for proper versioning

Demo: Build multi-arch with proper tags (2)

Create manifest list with all images:

docker manifest create --amend --insecure \
    localhost:5000/nicholasdille/hello \
    localhost:5000/nicholasdille/hello:arm \
    localhost:5000/nicholasdille/hello:arm64 \
docker manifest inspect localhost:5000/nicholasdille/hello