-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs about how to use stargz-snapshotter on Lima
Signed-off-by: Kohei Tokunaga <[email protected]>
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Using stargz-snapshotter on Lima | ||
|
||
This document describes how to get started with stargz-snapshotter on [Lima](https://github.com/lima-vm/lima). | ||
Lima's default image includes stargz-snapshotter so you don't need additional installation on the VM. | ||
|
||
## 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 | ||
env: | ||
CONTAINERD_SNAPSHOTTER: stargz | ||
EOF | ||
$ limactl stop | ||
$ limactl start | ||
$ nerdctl.lima system info | grep Storage | ||
Storage Driver: stargz | ||
``` | ||
|
||
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. | ||
>>> | ||
``` |