'Build image with builctl (buildkit) then run it with docker

I'd like to use the latest version of buildkit to build my docker images, because of some bugs in the buildkit version included in the latest release of docker.

Is it possible to build a local version of an image with the buildctl command, and then run this image with docker run?

I've tried adding --output type=image,name=<tag>,push=false but docker did not find this image. I'd like to avoid pushing this image as it is only used for running some tests. I've managed to export the cache locally with --export-cache type=local,dest=<folder> but I'm unsure how to use it from docker run.

Alternatively, is it possible to upgrade the buildkit version that docker uses in their released dind container?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source