2

I am relatively new to docker and saw in other repositories that we can push multiple digests under same tag with different OS/ARCH in docker. For example:

enter image description here

How can I achieve the same? Right now whenever I do docker push [REPO_LINK] from different architectures, it replaces the last pushed one with it's architecture. Thanks!

psr
  • 2,619
  • 4
  • 32
  • 57
  • https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/ – KamilCuk Jun 12 '21 at 08:20
  • In this example, it looks like the build for multi arch is happening on the same machine, whereas I am building on different machines and pushing via each of them. – psr Jun 12 '21 at 08:24
  • I believe this is a duplicate: https://stackoverflow.com/q/67961885/596285 – BMitch Jun 22 '21 at 00:59

2 Answers2

0

You might be looking for fat manifest aka manifest list.

It enables building images with multiple architectures under same tag. You need to use docker manifest command, when using multiple machines.

Once you have pushed images from different machines, you have to finally combine the manifests of these images into single one (called as manifest list). See more from official docs.

This blog post was already mentioned in one comment, but you can still use that docker manifest example to combine manifests to single file, even if you are not working only on one machine.

Related question: Is it possible to push docker images for different architectures separately?

Niklas
  • 1,480
  • 4
  • 10
0

There are two options I know of.

First, you can have buildx run builds on multiple nodes, one for each platform, rather than using qemu. For that, you would use docker buildx create --append to add the additional nodes to the builder instance. The downside of this is you'll need the nodes accessible from the node running docker buildx which typically doesn't apply to ephemeral cloud build environments.

The second option is to use the experimental docker manifest command. Each builder would push a separate tag. And at the end of all those, you would use docker manifest create to build a manifest list and docker manifest push to push that to a registry. Since this is an experimental feature, you'll want to export DOCKER_CLI_EXPERIMENTAL=enabled to see it in the command line. (You can also modify ~/.docker/config.json to have an "experimental": "enabled" entry.)

BMitch
  • 231,797
  • 42
  • 475
  • 450