Build a manifest list easily!
Imagine your username is foo
, your product that you're shipping in a Docker image is named bar
and the version is v1
. You have built that image for multiple architectures (amd64, arm and arm64) and want to ship that as a manifest list.
Then you can do that like this:
$ # You should do this in a for loop, but anyway
$ docker build -f Dockerfile.amd64 -t foo/bar-amd64:v1 .
$ docker push foo/bar-amd64:v1
$ docker build -f Dockerfile.arm -t foo/bar-arm:v1 .
$ docker push foo/bar-arm:v1
$ docker build -f Dockerfile.arm64 -t foo/bar-arm64:v1 .
$ docker push foo/bar-arm64:v1
$ ./manifest-tool push from-args \
--platforms linux/amd64,linux/arm,linux/arm64 \
--template foo/bar-ARCH:v1 \
--target foo/bar:v1
... and you have a manifest list that makes docker clients 1.10+ on amd64, arm and arm64 pull the right image for the right architecture!
--platforms
specifies which platforms you want to push for
--tempate
specifies which images it should take as inputs, it will replace the OS and ARCH placeholders for every platform and that way make up the list
--target
specifies the target image that should be a manifest list
$ ./manifest-tool push from-args \
--platforms linux/amd64,linux/arm,linux/arm64 \
--template foo/bar-ARCH:v1 \
--target foo/bar:v1
is the same as running
$ ./manifest-tool push from-spec ./spec.yaml
image: foo/bar:v1
manifests:
- image: foo/bar-amd64:v1
platform:
architecture: amd64
os: linux
- image: foo/bar-arm:v1
platform:
architecture: arm
os: linux
- image: foo/bar-arm64:v1
platform:
architecture: arm64
os: linux
Downloads
$ wget https://github.com/luxas/manifest-tool/releases/download/v0.3.0/manifest-tool
$ chmod +x manifest-tool
$ ./manifest-tool