| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | minimumLimaVersion: 2.0.0 |
| 14 | |
| 15 | base: |
| 16 | - template:_images/fedora |
| 17 | - template:_default/mounts |
| 18 | |
| 19 | containerd: |
| 20 | system: false |
| 21 | user: false |
| 22 | provision: |
| 23 | - mode: system |
| 24 | script: | |
| 25 | #!/bin/bash |
| 26 | set -eux -o pipefail |
| 27 | command -v podman >/dev/null 2>&1 && test -e /etc/lima-podman && exit 0 |
| 28 | dnf -y install --best podman && touch /etc/lima-podman |
| 29 | - mode: user |
| 30 | script: | |
| 31 | #!/bin/bash |
| 32 | set -eux -o pipefail |
| 33 | systemctl --user enable --now podman.socket |
| 34 | probes: |
| 35 | - script: | |
| 36 | #!/bin/bash |
| 37 | set -eux -o pipefail |
| 38 | if ! timeout 30s bash -c "until command -v podman >/dev/null 2>&1; do sleep 3; done"; then |
| 39 | echo >&2 "podman is not installed yet" |
| 40 | exit 1 |
| 41 | fi |
| 42 | hint: See "/var/log/cloud-init-output.log" in the guest |
| 43 | portForwards: |
| 44 | - guestSocket: "/run/user/{{.UID}}/podman/podman.sock" |
| 45 | hostSocket: "{{.Dir}}/sock/podman.sock" |
| 46 | message: | |
| 47 | To run `podman` on the host (assumes podman-remote is installed), run the following commands: |
| 48 | ------ |
| 49 | podman system connection add lima-{{.Name}} "unix://{{.Dir}}/sock/podman.sock" |
| 50 | podman system connection default lima-{{.Name}} |
| 51 | podman{{if eq .HostOS "linux"}} --remote{{end}} run quay.io/podman/hello |
| 52 | ------ |