snapshotter是containerd的模块,可以通过plugin的方式配置插件

snapshotter概念

对应于容器的layer。
Docker containers, from the beginning, have long been built on a snapshotting methodology known as layers. Layers provide the ability to fork a filesystem, make changes then save the changeset back to a new layer.
Historically, these have been tightly integrated into the Docker daemon as a component called the graphdriver. The graphdriver allows one to run the docker daemon on several different operating systems while still maintaining roughly similar snapshot semantics for committing and distributing changes to images.
The graphdriver is deeply integrated with the import and export of images, including managing layer relationships and container runtime filesystems. The behavior of the graphdriver informs the transport of image formats.
In this document, we propose a more flexible model for managing layers. It focuses on providing an API for the base snapshotting functionality without coupling so tightly to the structure of images and their identification. The minimal API simplifies behavior without sacrificing power. This makes the surface area for driver implementations smaller, ensuring that behavior is more consistent between implementations.
These differ from the concept of the graphdriver in that the Snapshotter has no knowledge of images or containers. Users simply prepare and commit directories. We also avoid the integration between graph drivers and the tar format used to represent the changesets.

https://github.com/containerd/containerd/blob/master/design/snapshots.md

通过ctr-remote转换镜像:

This optimization is done by baking the information about files that are likely accessed during runtime (called prioritized files), to the image. On runtime, Stargz Snapshotter prefetches these prioritized files before mounting the layer for making sure these files are locally accessible. This can avoid downloading chunks on every file read and mitigate the runtime performance drawbacks.

https://github.com/containerd/stargz-snapshotter/blob/master/docs/ctr-remote.md

eStargz and its optimization的原理:

https://github.com/containerd/stargz-snapshotter/blob/master/docs/stargz-estargz.md