-
Notifications
You must be signed in to change notification settings - Fork 625
/
Copy pathapptainer.yaml
48 lines (46 loc) · 1.88 KB
/
apptainer.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# A template to use Apptainer instead of containerd & nerdctl
# $ limactl start ./apptainer.yaml
# $ limactl shell apptainer apptainer run -u -B $HOME:$HOME docker://alpine
images:
# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months.
- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20250115/ubuntu-24.04-server-cloudimg-amd64.img"
arch: "x86_64"
digest: "sha256:28d2f9df3ac0d24440eaf6998507df3405142cf94a55e1f90802c78e43d2d9df"
- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20250115/ubuntu-24.04-server-cloudimg-arm64.img"
arch: "aarch64"
digest: "sha256:f11282a728ad42f8bfe0b646a6807674d79a019bfc229d80032345dd3228a2db"
# Fallback to the latest release image.
# Hint: run `limactl prune` to invalidate the cache
- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img"
arch: "x86_64"
- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img"
arch: "aarch64"
mounts:
- location: "~"
- location: "/tmp/lima"
writable: true
containerd:
system: false
user: false
provision:
- mode: system
script: |
#!/bin/bash
set -eux -o pipefail
command -v apptainer >/dev/null 2>&1 && exit 0
# Workaround for https://github.com/apptainer/apptainer/issues/2027
echo "kernel.apparmor_restrict_unprivileged_userns = 0" >/etc/sysctl.d/99-userns.conf
sysctl --system
# add the "Official PPA for Apptainer"
add-apt-repository -y ppa:apptainer/ppa
apt-get update
apt-get install -y apptainer
probes:
- script: |
#!/bin/bash
set -eux -o pipefail
if ! timeout 30s bash -c "until command -v apptainer >/dev/null 2>&1; do sleep 3; done"; then
echo >&2 "apptainer is not installed yet"
exit 1
fi
hint: See "/var/log/cloud-init-output.log" in the guest