Skip to content

Add docs about how to use stargz-snapshotter on Lima #1967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,7 @@ We assume that you are using CRI-O newer than https://github.com/cri-o/cri-o/pul
systemctl restart containerd
systemctl restart docker
```

## Using stargz-snapshotter on Lima

See [`./lima.md`](./lima.md)
52 changes: 52 additions & 0 deletions docs/lima.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Getting started with Stargz Snapshotter on Lima

[Lima](https://github.com/lima-vm/lima) is a tool to manage Linux virtual machines on various hosts, including MacOS and Linux.
Lima can be used as an easy way to get started with Stargz Snapshotter as Lima provides a default VM image bundling [containerd](https://github.com/containerd/containerd), [nerdctl](https://github.com/containerd/nerdctl)(Docker-compatible CLI of containerd) and Stargz Snapshotter.

This document describes how to get started with Stargz Snapshotter on Lima.

## Enable Stargz Snapshotter using `--snapshotter=stargz` flag

nerdctl's `--snapshotter=stargz` flag enables stargz-snapshotter.

```
$ nerdctl.lima --snapshotter=stargz system info | grep stargz
Storage Driver: stargz
```

Using this flag, you can perform lazy pulling of a python eStargz image and run it.

```
$ nerdctl.lima --snapshotter=stargz run --rm -it --name python ghcr.io/stargz-containers/python:3.13-esgz
Python 3.13.2 (main, Feb 6 2025, 22:37:13) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
```

## Use Stargz Snapshotter as the default snapshotter

nerdctl recognizes an environment variable `CONTAINERD_SNAPSHOTTER` for the snapshotter to use.
You can add this environment variable to the VM by configuring Lima config as shown in the following:

```
$ cat <<EOF >> ~/.lima/_config/override.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be noted that override.yaml applies to all the instances of Lima

env:
CONTAINERD_SNAPSHOTTER: stargz
EOF
$ limactl stop
$ limactl start
$ nerdctl.lima system info | grep Storage
Storage Driver: stargz
```

> NOTE: `override.yaml` applies to all the instances of Lima


You can perform lazy pulling of eStargz using nerdctl, without any extra flags.

```
$ nerdctl.lima run --rm -it --name python ghcr.io/stargz-containers/python:3.13-esgz
Python 3.13.2 (main, Feb 6 2025, 22:37:13) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
```
Loading