Create a manifest list
In this step, we will learn how to create a manifest list in Docker. A manifest list is a list of image manifests, which allows you to use a single image name to refer to images for different architectures and operating systems. This is particularly useful for building multi-architecture images.
First, let's pull two different images that we will use to create our manifest list. We will use the alpine
image for amd64
and arm64
architectures.
docker pull alpine:latest
docker pull --platform arm64 alpine:latest
The first command pulls the alpine:latest
image for your current architecture (likely amd64
). The second command explicitly pulls the alpine:latest
image for the arm64
architecture.
Now, we can create the manifest list using the docker manifest create
command. The syntax is docker manifest create TARGET_IMAGE SOURCE_IMAGE [SOURCE_IMAGE...]
. We will create a manifest list named my-alpine:latest
that includes the alpine:latest
images for amd64
and arm64
.
docker manifest create my-alpine:latest alpine:latest alpine:latest --amend alpine:latest --platform arm64
In this command:
my-alpine:latest
is the name of the new manifest list we are creating.
alpine:latest
is the first source image (for the default architecture).
--amend alpine:latest --platform arm64
adds the alpine:latest
image for the arm64
platform to the manifest list.
After running this command, you have created a manifest list locally. However, it is not yet pushed to a registry. We will push it in a later step.