使用 eStargz 加速启动时间

eStargz 是一种与 OCI 兼容的容器镜像格式,它使用延迟拉取技术来减少启动延迟。

对 eStargz 的支持默认可用于 ubuntu-24.04 实例:

limactl start --name=default template://ubuntu-24.04

最新的 Ubuntu 也将在 未来版本 中得到支持。

没有 eStargz:

$ time lima nerdctl run --platform=amd64 ghcr.io/stargz-containers/python:3.13-org python3 -c 'print("hi")'
[...]
hi

real	0m23.767s
user	0m0.025s
sys	0m0.020s

使用 eStargz:

$ time lima nerdctl --snapshotter=stargz run --platform=amd64 ghcr.io/stargz-containers/python:3.13-esgz python3 -c 'print("hi")'
[...]
hi

real	0m13.365s
user	0m0.026s
sys	0m0.021s

可以在以下位置找到 eStargz 镜像示例: https://github.com/containerd/stargz-snapshotter/blob/main/docs/pre-converted-images.md

另请参见: