Skip to content

Commit f839d37

Browse files
authored
Merge pull request #1967 from ktock/limadocs
Add docs about how to use stargz-snapshotter on Lima
2 parents 921268f + 90f3328 commit f839d37

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

docs/INSTALL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,7 @@ We assume that you are using CRI-O newer than https://github.com/cri-o/cri-o/pul
174174
systemctl restart containerd
175175
systemctl restart docker
176176
```
177+
178+
## Using stargz-snapshotter on Lima
179+
180+
See [`./lima.md`](./lima.md)

docs/lima.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Getting started with Stargz Snapshotter on Lima
2+
3+
[Lima](https://github.com/lima-vm/lima) is a tool to manage Linux virtual machines on various hosts, including MacOS and Linux.
4+
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.
5+
6+
This document describes how to get started with Stargz Snapshotter on Lima.
7+
8+
## Enable Stargz Snapshotter using `--snapshotter=stargz` flag
9+
10+
nerdctl's `--snapshotter=stargz` flag enables stargz-snapshotter.
11+
12+
```
13+
$ nerdctl.lima --snapshotter=stargz system info | grep stargz
14+
Storage Driver: stargz
15+
```
16+
17+
Using this flag, you can perform lazy pulling of a python eStargz image and run it.
18+
19+
```
20+
$ nerdctl.lima --snapshotter=stargz run --rm -it --name python ghcr.io/stargz-containers/python:3.13-esgz
21+
Python 3.13.2 (main, Feb 6 2025, 22:37:13) [GCC 12.2.0] on linux
22+
Type "help", "copyright", "credits" or "license" for more information.
23+
>>>
24+
```
25+
26+
## Use Stargz Snapshotter as the default snapshotter
27+
28+
nerdctl recognizes an environment variable `CONTAINERD_SNAPSHOTTER` for the snapshotter to use.
29+
You can add this environment variable to the VM by configuring Lima config as shown in the following:
30+
31+
```
32+
$ cat <<EOF >> ~/.lima/_config/override.yaml
33+
env:
34+
CONTAINERD_SNAPSHOTTER: stargz
35+
EOF
36+
$ limactl stop
37+
$ limactl start
38+
$ nerdctl.lima system info | grep Storage
39+
Storage Driver: stargz
40+
```
41+
42+
> NOTE: `override.yaml` applies to all the instances of Lima
43+
44+
45+
You can perform lazy pulling of eStargz using nerdctl, without any extra flags.
46+
47+
```
48+
$ nerdctl.lima run --rm -it --name python ghcr.io/stargz-containers/python:3.13-esgz
49+
Python 3.13.2 (main, Feb 6 2025, 22:37:13) [GCC 12.2.0] on linux
50+
Type "help", "copyright", "credits" or "license" for more information.
51+
>>>
52+
```

0 commit comments

Comments
 (0)