buildx icon indicating copy to clipboard operation
buildx copied to clipboard

Multi-platform builds are not visible in the local Docker image registry

Open asreich opened this issue 1 year ago • 1 comments

Description

Problem: When running docker buildx build targeting multiple architectures the resulting images cannot be viewed in docker image ls. This works if you only target ONE platform per docker buildx build command, but not multiple.

I've read all of #166 and I understand the initial question was resolved but I haven't been able to find a followup issue for the related problem listed above. I have looked through the buildx CLI and have been unable to find a similar command to docker image ls that lists images instead of the buildx drivers listed by docker buildx ls.

Are there plans to enable this support in an upcoming release?

asreich avatar Sep 19 '24 18:09 asreich

@thaJeztah Transfer to moby? (Afaik this works with containerd store).

tonistiigi avatar Sep 25 '24 01:09 tonistiigi

Pardon my ignorance if I've got this wrong, but I thought you had to use --load to have then appear at all in the local images list?

toby-griffiths avatar Nov 06 '24 15:11 toby-griffiths

The --load option is needed if you are using a custom builder; e.g. if you created a builder using docker buildx create a separate instance of the BuildKit daemon is created that's running inside a container. In that case the BuildKit builder runs isolated from the Docker Engine and doesn't share the image store. When running a docker buildx build with that builder, result of the build only remains in the builder's cache, unless you either --push the result or --load the result into the Docker Engine.

If you use the default builder (the BuildKit instance that's compiled into the Docker Engine itself), it's not needed to --load the image, because BuildKit in that case shares the image store with the Docker Engine. However for multi-platform builds, you need to have the containerd image store enabled to allow the Docker Engine's image store to preserve multi-platform images (without the containerd image store, it can only store a single platform per image);

  • on docker desktop: https://docs.docker.com/desktop/containerd/
  • on docker engine on linux; https://docs.docker.com/engine/storage/containerd/

With the containerd image store enabled, you don't need a custom builder for building multi-platform images (so you can use docker builder use default to use the built-in version of BuildKit)

thaJeztah avatar Nov 06 '24 16:11 thaJeztah