| 1 | |
| 2 | |
| 3 | |
| 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 | # add the "Official PPA for Apptainer" |
| 21 | add-apt-repository -y ppa:apptainer/ppa |
| 22 | apt-get update |
| 23 | apt-get install -y apptainer-suid |
| 24 | # Ubuntu 24.10 moved /tmp over to tmpfs |
| 25 | # Apptainer wants a regular filesystem TMPDIR: |
| 26 | # - Building images has a problem with "nodev" |
| 27 | # - The image might be too big to fit in memory |
| 28 | echo "APPTAINER_TMPDIR=/var/tmp" > /etc/profile.d/apptainer.sh |
| 29 | echo "export APPTAINER_TMPDIR" > /etc/profile.d/apptainer.sh |
| 30 | probes: |
| 31 | - script: | |
| 32 | #!/bin/bash |
| 33 | set -eux -o pipefail |
| 34 | if ! timeout 30s bash -c "until command -v apptainer >/dev/null 2>&1; do sleep 3; done"; then |
| 35 | echo >&2 "apptainer is not installed yet" |
| 36 | exit 1 |
| 37 | fi |
| 38 | hint: See "/var/log/cloud-init-output.log" in the guest |