Skip to content

Commit 78e5366

Browse files
authored
Merge pull request #887 from afbjorklund/apptainer-rocky
Add example for apptainer running on rocky
2 parents ecd6a49 + 9d88c9d commit 78e5366

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Others:
3636
- [`deprecated/centos-7.yaml`](./deprecated/centos-7.yaml): [deprecated] CentOS 7
3737
- [`experimental/9p.yaml`](experimental/9p.yaml): [experimental] use 9p mount type
3838
- [`experimental/riscv64.yaml`](experimental/riscv64.yaml): [experimental] RISC-V
39+
- [`experimental/apptainer.yaml`](./experimental/apptainer.yaml): [experimental] [Apptainer](https://apptainer.org/)
3940

4041
## Tier 1
4142

examples/experimental/apptainer.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Example 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+
# This example requires Lima v0.8.3 or later.
6+
7+
# NOTE: skip 8.6-20220515, as it seems broken (lacks sudo): https://bugs.rockylinux.org/view.php?id=102
8+
images:
9+
- location: "https://dl.rockylinux.org/pub/rocky/8.5/images/Rocky-8-GenericCloud-8.5-20211114.2.x86_64.qcow2"
10+
arch: "x86_64"
11+
digest: "sha256:c23f58f26f73fb9ae92bfb4cf881993c23fdce1bbcfd2881a5831f90373ce0c8"
12+
mounts:
13+
- location: "~"
14+
- location: "/tmp/lima"
15+
writable: true
16+
firmware:
17+
legacyBIOS: true
18+
cpuType:
19+
# Workaround for "vmx_write_mem: mmu_gva_to_gpa XXXXXXXXXXXXXXXX failed" on Intel Mac
20+
# https://bugs.launchpad.net/qemu/+bug/1838390
21+
x86_64: "Haswell-v4"
22+
containerd:
23+
system: false
24+
user: false
25+
provision:
26+
- mode: system
27+
script: |
28+
#!/bin/bash
29+
set -eux -o pipefail
30+
command -v apptainer >/dev/null 2>&1 && exit 0
31+
dnf install -y https://github.com/apptainer/apptainer/releases/download/v1.0.2/apptainer-1.0.2-1.x86_64.rpm
32+
probes:
33+
- script: |
34+
#!/bin/bash
35+
set -eux -o pipefail
36+
if ! timeout 30s bash -c "until command -v apptainer >/dev/null 2>&1; do sleep 3; done"; then
37+
echo >&2 "apptainer is not installed yet"
38+
exit 1
39+
fi
40+
hint: See "/var/log/cloud-init-output.log". in the guest

0 commit comments

Comments
 (0)