forked from lima-vm/lima
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalpine-podman.yaml
68 lines (66 loc) · 2.25 KB
/
alpine-podman.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# This template requires Lima v0.7.0 or later.
# Using the Alpine 3.18 aarch64 image with vmType=vz requires macOS Ventura 13.3 or later.
images:
- location: "https://github.com/lima-vm/alpine-lima/releases/download/v0.2.32/alpine-lima-std-3.18.0-x86_64.iso"
arch: "x86_64"
digest: "sha512:7b00fff78736a27a24e4a7de5f28037e9c7cf0fc539a33ec551c6ac619eb54237b5f25bfa35512fa7233cf23396dc249592710ef9150f619afa15267f9c8cbd4"
- location: "https://github.com/lima-vm/alpine-lima/releases/download/v0.2.32/alpine-lima-std-3.18.0-aarch64.iso"
arch: "aarch64"
digest: "sha512:bf23a22e05854670eef74d9bfad056caa249832f22d5594eb6bb02fa9aae109d33c764242f862d48de5b6715c4792a3ee29c19888a0711fb27113ba5cf1ccf21"
mounts:
- location: "~"
- location: "/tmp/lima"
writable: true
containerd:
system: false
user: false
provision:
- mode: system
script: |
#!/bin/bash
set -eux -o pipefail
# Set up subuid
for f in /etc/subuid /etc/subgid; do
grep -qw "${LIMA_CIDATA_USER}" $f || echo "${LIMA_CIDATA_USER}:100000:65536" >>$f
done
- mode: system
script: |
#!/bin/bash
set -eux -o pipefail
command -v podman >/dev/null 2>&1 && exit 0
apk add podman
- mode: system
script: |
#!/bin/bash
set -eux -o pipefail
if ! grep -q ^podman_user /etc/conf.d/podman; then
echo "podman_user=\"${LIMA_CIDATA_USER}\"" >> /etc/conf.d/podman
fi
rc-update add podman boot
service podman start
probes:
- description: "podman to be installed"
script: |
#!/bin/bash
set -eux -o pipefail
if ! timeout 30s bash -c "until command -v podman >/dev/null 2>&1; do sleep 3; done"; then
echo >&2 "podman is not installed yet"
exit 1
fi
- description: "podman to be running"
script: |
#!/bin/bash
set -eux -o pipefail
if ! timeout 30s bash -c "until pgrep podman; do sleep 3; done"; then
echo >&2 "podman is not running"
exit 1
fi
portForwards:
- guestSocket: "/tmp/podman-run-{{.UID}}/podman/podman.sock"
hostSocket: "{{.Dir}}/sock/podman.sock"
message: |
To run `podman` on the host (assumes podman-remote is installed), run the following commands:
------
export CONTAINER_HOST="unix://{{.Dir}}/sock/podman.sock"
podman{{if eq .HostOS "linux"}}-remote{{end}} run quay.io/podman/hello
------