File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed
cidata/cidata.TEMPLATE.d/boot Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 1
- #! /bin/sh
1
+ #! /bin/bash
2
2
set -eux
3
3
4
4
if [ " ${LIMA_CIDATA_CONTAINERD_SYSTEM} " != 1 ] && [ " ${LIMA_CIDATA_CONTAINERD_USER} " != 1 ]; then
8
8
# This script does not work unless systemd is available
9
9
command -v systemctl > /dev/null 2>&1 || exit 0
10
10
11
- if [ ! -x /usr/local/bin/nerdctl ]; then
11
+ # Extract bin/nerdctl and compare whether it is newer than the current /usr/local/bin/nerdctl (if already exists).
12
+ # Takes 4-5 seconds. (FIXME: optimize)
13
+ tmp_extract_nerdctl=" $( mktemp -d) "
14
+ tar Cxzf " ${tmp_extract_nerdctl} " " ${LIMA_CIDATA_MNT} " /nerdctl-full.tgz bin/nerdctl
15
+
16
+ if [ ! -f /usr/local/bin/nerdctl ] || [[ " ${tmp_extract_nerdctl} " /bin/nerdctl -nt /usr/local/bin/nerdctl ]]; then
17
+ if [ -f /usr/local/bin/nerdctl ]; then
18
+ (
19
+ set +e
20
+ echo " Upgrading existing nerdctl"
21
+ echo " - Old: $( /usr/local/bin/nerdctl --version) "
22
+ echo " - New: $( " ${tmp_extract_nerdctl} " /bin/nerdctl --version) "
23
+ systemctl disable --now containerd buildkit stargz-snapshotter
24
+ sudo -iu " ${LIMA_CIDATA_USER} " " XDG_RUNTIME_DIR=/run/user/${LIMA_CIDATA_UID} " " PATH=${PATH} " containerd-rootless-setuptool.sh uninstall
25
+ )
26
+ fi
12
27
tar Cxzf /usr/local " ${LIMA_CIDATA_MNT} " /nerdctl-full.tgz
13
28
14
29
mkdir -p /etc/bash_completion.d
15
30
nerdctl completion bash > /etc/bash_completion.d/nerdctl
16
31
# TODO: enable zsh completion too
17
32
fi
18
33
34
+ rm -rf " ${tmp_extract_nerdctl} "
35
+
19
36
if [ " ${LIMA_CIDATA_CONTAINERD_SYSTEM} " = 1 ]; then
20
37
mkdir -p /etc/containerd
21
38
cat > " /etc/containerd/config.toml" << EOF
Original file line number Diff line number Diff line change @@ -22,20 +22,20 @@ import (
22
22
)
23
23
24
24
func defaultContainerdArchives () []File {
25
- const nerdctlVersion = "0.17.0 "
25
+ const nerdctlVersion = "0.17.1 "
26
26
location := func (goarch string ) string {
27
27
return "https://github.com/containerd/nerdctl/releases/download/v" + nerdctlVersion + "/nerdctl-full-" + nerdctlVersion + "-linux-" + goarch + ".tar.gz"
28
28
}
29
29
return []File {
30
30
{
31
31
Location : location ("amd64" ),
32
32
Arch : X8664 ,
33
- Digest : "sha256:5eef74d5031b2f014a7f594e1f2ff319161a29f9309a56bee1a44fb90430a28d " ,
33
+ Digest : "sha256:046ac1c3d007b9b64880cb15a78ea1e0be345d31f51ff282be783a9c203f299d " ,
34
34
},
35
35
{
36
36
Location : location ("arm64" ),
37
37
Arch : AARCH64 ,
38
- Digest : "sha256:b0ae2fc89d362afa18afcc35798d4da613096613d06cae07181b777cd66002e8 " ,
38
+ Digest : "sha256:b773a0db178af9d0963b7c84df88ee434e0c1986fe7491dc1de3231e071e3921 " ,
39
39
},
40
40
}
41
41
}
You can’t perform that action at this time.
0 commit comments