Description
Hi!
With buildx and buildkit, it's possible to leverage Docker image in the stargz format. It's now even easier since Docker Desktop added support for containerd as the image store in beta, with the stargz snapshotter preinstalled.
This allow for much, much faster start of containers and could be a game changer in CI/CD where a lot of time is spent pulling images. Overall it's a net win for the user experience in general as docker pulls are much faster.
Docker image in the stargz format are backward compatible as the format is OCI-complient. See https://github.com/containerd/stargz-snapshotter
It's possible to build and push stargz Docker image by using buildkit and buildx. By using the option: compression=estargz,oci-mediatypes=true
and optionally force-compression=true
if the base image is not in the stargz format.
See https://github.com/moby/buildkit/blob/master/docs/stargz-estargz.md#creating-stargzestargz-images for more information about stargz and buildkit.
It's backward compatible so shouldn't be an issue to build all the new Docker images with this format, but we can be careful and for a time provide a new suffix -esgz
for users who want to try lazy pulling with stargz. This doubles the number of images build but ensure maybe a smoother path to stargz while bugs are flushed out of the buildkit exporter (if any)