@@ -29,6 +29,44 @@ provision:
2929 - mode : user
3030 script : |
3131 #!/bin/bash
32+
33+ # Override runc with specified version after container runtime is installed
34+ ARCH=$(uname -m)
35+ if [ "$ARCH" = "x86_64" ]; then
36+ RUNC_URL="<runc_override_x86_64_location>"
37+ RUNC_DIGEST="<runc_override_x86_64_digest>"
38+ elif [ "$ARCH" = "aarch64" ]; then
39+ RUNC_URL="<runc_override_aarch64_location>"
40+ RUNC_DIGEST="<runc_override_aarch64_digest>"
41+ else
42+ echo "Unsupported architecture: $ARCH"
43+ exit 1
44+ fi
45+
46+ # Download and verify runc override
47+ curl -L --fail "$RUNC_URL" -o /tmp/runc-override
48+ echo "$RUNC_DIGEST /tmp/runc-override" | sha256sum -c -
49+
50+ # Replace the existing runc binary
51+ sudo chmod +x /tmp/runc-override
52+ sudo cp /tmp/runc-override /usr/local/bin/runc
53+ sudo cp /tmp/runc-override /usr/bin/runc
54+ sudo rm /tmp/runc-override
55+
56+ # Verify runc version is >= 1.3.2
57+ INSTALLED_VERSION=$(runc --version | head -n1 | awk '{print $3}')
58+ REQUIRED_VERSION="1.3.2"
59+ if ! printf '%s\n%s\n' "$REQUIRED_VERSION" "$INSTALLED_VERSION" | sort -V -C; then
60+ echo "ERROR: runc version $INSTALLED_VERSION is less than required $REQUIRED_VERSION"
61+ exit 1
62+ fi
63+ echo "SUCCESS: runc version $INSTALLED_VERSION meets requirement >= $REQUIRED_VERSION"
64+
65+ # Restart containerd
66+ sudo systemctl restart containerd.service
67+ - mode : user
68+ script : |
69+ #!/bin/bash
3270
3371 # Enable SSHing into the VM as root (e.g., in `nerdctlConfigApplier.Apply`).
3472 sudo cp ~/.ssh/authorized_keys /root/.ssh/
@@ -92,6 +130,7 @@ provision:
92130 sudo systemctl daemon-reload
93131
94132 sudo systemctl restart containerd.service
133+
95134env :
96135 # Containerd namespace is used by the lima cidata script
97136 # 40-install-containerd.sh. Specifically this variable is defining the
0 commit comments