Skip to content

Commit 4aa6303

Browse files
committed
cidata: support system-wide buildkit and stargz-snapshotter
Signed-off-by: Akihiro Suda <[email protected]>
1 parent e9499c1 commit 4aa6303

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

pkg/cidata/user-data.TEMPLATE

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,25 @@ write_files:
109109
curl -fsSL https://github.com/containerd/nerdctl/releases/download/v${version}/nerdctl-full-${version}-linux-${goarch}.tar.gz | tar Cxz /usr/local
110110
fi
111111
{{- if .Containerd.System}}
112-
systemctl enable containerd
113-
systemctl start containerd
112+
cat >"/etc/containerd/config.toml" <<EOF
113+
version = 2
114+
[proxy_plugins]
115+
[proxy_plugins."stargz"]
116+
type = "snapshot"
117+
address = "/run/containerd-stargz-grpc/containerd-stargz-grpc.sock"
118+
EOF
119+
systemctl enable --now containerd buildkit stargz-snapshotter
114120
{{- end}}
115121
{{- if .Containerd.User}}
116122
modprobe tap || true
117123
if [ ! -e "/home/{{.User}}.linux/.config/containerd/config.toml" ]; then
118124
mkdir -p "/home/{{.User}}.linux/.config/containerd"
119125
cat >"/home/{{.User}}.linux/.config/containerd/config.toml" <<EOF
126+
version = 2
120127
[proxy_plugins]
121128
[proxy_plugins."stargz"]
122-
type = "snapshot"
123-
address = "/run/user/{{.UID}}/containerd-stargz-grpc/containerd-stargz-grpc.sock"
129+
type = "snapshot"
130+
address = "/run/user/{{.UID}}/containerd-stargz-grpc/containerd-stargz-grpc.sock"
124131
EOF
125132
chown -R "{{.User}}" "/home/{{.User}}.linux/.config"
126133
fi

pkg/limayaml/default.TEMPLATE.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ video:
5959
display: "none"
6060

6161
containerd:
62-
# Enable system-wide containerd (systemctl enable containerd)
62+
# Enable system-wide (aka rootful) containerd and its dependencies (BuildKit, Stargz Snapshotter)
6363
# Default: false
6464
system: false
65-
# Enable user-scoped containerd (systemctl --user enable containerd)
65+
# Enable user-scoped (aka rootless) containerd and its dependencies
6666
# Default: true
6767
user: true
6868

0 commit comments

Comments
 (0)