Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
lima-vm
GitHub Repository: lima-vm/lima
Path: blob/master/templates/apptainer.yaml
2621 views
1
# A template to use Apptainer instead of containerd & nerdctl
2
# $ limactl start ./apptainer.yaml
3
# $ limactl shell apptainer apptainer run -u -B $HOME:$HOME docker://alpine
4
5
minimumLimaVersion: 2.0.0
6
7
base:
8
- template:_images/ubuntu-lts
9
- template:_default/mounts
10
11
containerd:
12
system: false
13
user: false
14
provision:
15
- mode: system
16
script: |
17
#!/bin/bash
18
set -eux -o pipefail
19
command -v apptainer >/dev/null 2>&1 && exit 0
20
# Workaround for https://github.com/apptainer/apptainer/issues/2027
21
echo "kernel.apparmor_restrict_unprivileged_userns = 0" >/etc/sysctl.d/99-userns.conf
22
sysctl --system
23
# add the "Official PPA for Apptainer"
24
add-apt-repository -y ppa:apptainer/ppa
25
apt-get update
26
apt-get install -y apptainer
27
probes:
28
- script: |
29
#!/bin/bash
30
set -eux -o pipefail
31
if ! timeout 30s bash -c "until command -v apptainer >/dev/null 2>&1; do sleep 3; done"; then
32
echo >&2 "apptainer is not installed yet"
33
exit 1
34
fi
35
hint: See "/var/log/cloud-init-output.log" in the guest
36
37