Skip to content
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

Provide option to enable containerd stargz-snapshotter #1202

Open
FloThinksPi opened this issue Nov 26, 2024 · 1 comment
Open

Provide option to enable containerd stargz-snapshotter #1202

FloThinksPi opened this issue Nov 26, 2024 · 1 comment

Comments

@FloThinksPi
Copy link

Description

Current colima(the VM it provisions) already comes with the stargz-snapshotter preinstalled but not started or configured. To be able to use it one must ssh into the lima VM with colima ssh and configure and start the services. I used following commands to set up config/systemd-services and start them:

sudo mkdir -p /etc/containerd
sudo mkdir -p /etc/containerd-stargz-grpc/
sudo sh -c 'echo """version = 2
[plugins.\"io.containerd.grpc.v1.cri\".containerd]
  snapshotter = \"stargz\"
  disable_snapshot_annotations = false
[proxy_plugins]
  [proxy_plugins.stargz]
    type = \"snapshot\"
    address = \"/run/containerd-stargz-grpc/containerd-stargz-grpc.sock\"
""" > /etc/containerd/config.toml
echo """[Unit]
Description=stargz snapshotter
After=network.target
Before=containerd.service

[Service]
Type=notify
Environment=HOME=/root
ExecStart=/usr/local/bin/containerd-stargz-grpc --log-level=debug --config=/etc/containerd-stargz-grpc/config.toml
Restart=always
RestartSec=1

[Install]
WantedBy=multi-user.target
""" > /etc/systemd/system/stargz-snapshotter.service
sudo echo """[cri_keychain]
enable_keychain = true
image_service_path = \"/run/containerd/containerd.sock\"
""" > /etc/containerd-stargz-grpc/config.toml'
sudo systemctl daemon-reload
sudo systemctl enable stargz-snapshotter --now
sudo systemctl restart containerd

Could this be done/configured via a config property in the colima vm template(or maybe even as default) so i can use nerdctl --snapshotter=stargz run ... easily to make use of lazy pulling ?

@abiosoft
Copy link
Owner

If there are no side-effects to having it enabled, then it can be enabled by default.
Yeah, the steps you detailed can be handled internally by Colima.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants