Debian Codegraph @

docs/INSTALL.md

raw
1 # Install Stargz Snapshotter and Stargz Store
2
3 ## What's Stargz Snapshotter and Stargz Store?
4
5 *Stargz Snapshotter* is a plugin for containerd, which enables it to perform lazy pulling of eStargz.
6 This is an implementation of *remote snapshotter* plugin and provides remotely-mounted eStargz layers to containerd.
7 Communication between containerd and Stargz Snapshotter is done with gRPC over unix socket.
8 For more details about Stargz Snapshotter and the relationship with containerd, [please refer to the doc](./overview.md).
9
10 If you are using CRI-O/Podman, you can't use Stargz Snapshotter for enabling lazy pulling of eStargz.
11 Instead, use *Stargz Store* plugin.
12 This is an implementation of *additional layer store* plugin of CRI-O/Podman.
13 Stargz Store provides remotely-mounted eStargz layers to CRI-O/Podman.
14
15 Stargz Store exposes mounted filesystem structured like the following.
16 CRI-O/Podman access to this filesystem to acquire eStargz layers.
17
18 ```
19 <mountpoint>/base64(imageref)/<layerdigest>/
20 - diff : exposes the extracted eStargz layer
21 - info : contains JSON-formatted metadata of this layer
22 - use : files to notify the use of this layer (used for GC)
23 ```
24
25 ## Install Stargz Snapshotter for containerd with Systemd
26
27 To enable lazy pulling of eStargz on containerd, you need to install *Stargz Snapshotter* plugin.
28 This section shows the step to install Stargz Snapshotter with systemd.
29 We assume that you are using containerd (> v1.4.2) as a CRI runtime.
30
31 - Download release tarball from [the release page](https://github.com/containerd/stargz-snapshotter/releases).
32
33 - Add the following configuration to containerd's configuration file (typically: /etc/containerd/config.toml). Please see also [an example configuration file](../script/config/etc/containerd/config.toml).
34 ```toml
35 version = 2
36
37 # Enable stargz snapshotter for CRI
38 [plugins."io.containerd.grpc.v1.cri".containerd]
39 snapshotter = "stargz"
40 disable_snapshot_annotations = false
41
42 # Plug stargz snapshotter into containerd
43 [proxy_plugins]
44 [proxy_plugins.stargz]
45 type = "snapshot"
46 address = "/run/containerd-stargz-grpc/containerd-stargz-grpc.sock"
47
48 ```
49
50 - Install fuse
51
52 ###### centos
53 ```
54 # centos 7
55 yum install fuse
56 # centos 8
57 dnf install fuse
58
59 modprobe fuse
60 ```
61
62 ###### ubuntu
63
64 ```
65 apt-get install fuse
66 modprobe fuse
67 ```
68
69 - Start stargz-snapshotter and restart containerd
70 ```
71 tar -C /usr/local/bin -xvf stargz-snapshotter-${version}-linux-${arch}.tar.gz containerd-stargz-grpc ctr-remote
72 wget -O /etc/systemd/system/stargz-snapshotter.service https://raw.githubusercontent.com/containerd/stargz-snapshotter/main/script/config/etc/systemd/system/stargz-snapshotter.service
73 systemctl enable --now stargz-snapshotter
74 systemctl restart containerd
75 ```
76
77 ## Install Stargz Store for CRI-O/Podman with Systemd
78
79 To enable lazy pulling of eStargz on CRI-O/Podman, you need to install *Stargz Store* plugin.
80 This section shows the step to install Stargz Store with systemd.
81 We assume that you are using CRI-O newer than https://github.com/cri-o/cri-o/pull/4850 or Podman newer than https://github.com/containers/podman/pull/10214 .
82
83 - Download release tarball from [the release page](https://github.com/containerd/stargz-snapshotter/releases).
84
85 - Add the following configuration to the storage configuration file of CRI-O/Podman (typically: /etc/containers/storage.conf). Please see also [an example configuration file](../script/config-cri-o/etc/containers/storage.conf).
86 ```toml
87 [storage]
88 driver = "overlay"
89 graphroot = "/var/lib/containers/storage"
90 runroot = "/run/containers/storage"
91
92 [storage.options]
93 additionallayerstores = ["/var/lib/stargz-store/store:ref"]
94 ```
95
96 - Install fuse
97
98 ###### centos
99 ```
100 # centos 7
101 yum install fuse
102 # centos 8
103 dnf install fuse
104
105 modprobe fuse
106 ```
107
108 ###### ubuntu
109
110 ```
111 apt-get install fuse
112 modprobe fuse
113 ```
114
115 - Start stargz-store (CRI-O also needs to be restarted if you are using)
116 ```
117 tar -C /usr/local/bin -xvf stargz-snapshotter-${version}-linux-${arch}.tar.gz stargz-store
118 wget -O /etc/systemd/system/stargz-store.service https://raw.githubusercontent.com/containerd/stargz-snapshotter/main/script/config-cri-o/etc/systemd/system/stargz-store.service
119 systemctl enable --now stargz-store
120 systemctl restart cri-o # if you are using CRI-O
121 ```
122
123 ## Install Stargz Snapshotter for Docker(Moby) with Systemd
124
125 - Docker(Moby) newer than [`5c1d6c957b97321c8577e10ddbffe6e01981617a`](https://github.com/moby/moby/commit/5c1d6c957b97321c8577e10ddbffe6e01981617a) is needed on your host. The commit is expected to be included in Docker v24.
126
127 - Download stargz-snapshotter release tarball from [the release page](https://github.com/containerd/stargz-snapshotter/releases).
128
129 - Enable `containerd-snapshotter` feature and `stargz` snapshotter in Docker. Add the following to docker's configuration file (typically: /etc/docker/daemon.json).
130 ```json
131 {
132 "features": {
133 "containerd-snapshotter": true
134 },
135 "storage-driver": "stargz"
136 }
137 ```
138
139 - Enable stargz snapshotter in containerd. Add the following configuration to containerd's configuration file (typically: /etc/containerd/config.toml).
140 ```toml
141 version = 2
142
143 # Plug stargz snapshotter into containerd
144 [proxy_plugins]
145 [proxy_plugins.stargz]
146 type = "snapshot"
147 address = "/run/containerd-stargz-grpc/containerd-stargz-grpc.sock"
148 ```
149
150 - Install fuse
151
152 ###### centos
153 ```
154 # centos 7
155 yum install fuse
156 # centos 8
157 dnf install fuse
158
159 modprobe fuse
160 ```
161
162 ###### ubuntu
163
164 ```
165 apt-get install fuse
166 modprobe fuse
167 ```
168
169 - Start stargz-snapshotter and restart containerd and docker
170 ```
171 tar -C /usr/local/bin -xvf stargz-snapshotter-${version}-linux-${arch}.tar.gz containerd-stargz-grpc ctr-remote
172 wget -O /etc/systemd/system/stargz-snapshotter.service https://raw.githubusercontent.com/containerd/stargz-snapshotter/${version}/script/config/etc/systemd/system/stargz-snapshotter.service
173 systemctl enable --now stargz-snapshotter
174 systemctl restart containerd
175 systemctl restart docker
176 ```