File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ # A template to use Podman on Ubuntu instead of containerd & nerdctl
2
+ # $ limactl start ./podman-ubuntu-lts.yaml
3
+ # $ limactl shell podman podman run -it -v $HOME:$HOME --rm docker.io/library/alpine
4
+
5
+ # To run `podman` on the host (assumes podman-remote is installed):
6
+ # $ export CONTAINER_HOST=$(limactl list podman --format 'unix://{{.Dir}}/sock/podman.sock')
7
+ # $ podman --remote ...
8
+
9
+ # To run `docker` on the host (assumes docker-cli is installed):
10
+ # $ export DOCKER_HOST=$(limactl list podman --format 'unix://{{.Dir}}/sock/podman.sock')
11
+ # $ docker ...
12
+
13
+ minimumLimaVersion : 1.1.0
14
+
15
+ base :
16
+ - template://_images/ubuntu-lts
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
+ export DEBIAN_FRONTEND=noninteractive
29
+ apt-get update
30
+ apt-get install -y podman && touch /etc/lima-podman
31
+ - mode : user
32
+ script : |
33
+ #!/bin/bash
34
+ set -eux -o pipefail
35
+ systemctl --user enable --now podman.socket
36
+ probes :
37
+ - script : |
38
+ #!/bin/bash
39
+ set -eux -o pipefail
40
+ if ! timeout 30s bash -c "until command -v podman >/dev/null 2>&1; do sleep 3; done"; then
41
+ echo >&2 "podman is not installed yet"
42
+ exit 1
43
+ fi
44
+ hint: See "/var/log/cloud-init-output.log" in the guest
45
+ portForwards :
46
+ - guestSocket : " /run/user/{{.UID}}/podman/podman.sock"
47
+ hostSocket : " {{.Dir}}/sock/podman.sock"
48
+ message : |
49
+ To run `podman` on the host (assumes podman-remote is installed), run the following commands:
50
+ ------
51
+ podman system connection add lima-{{.Name}} "unix://{{.Dir}}/sock/podman.sock"
52
+ podman system connection default lima-{{.Name}}
53
+ podman{{if eq .HostOS "linux"}} --remote{{end}} run quay.io/podman/hello
54
+ ------
You can’t perform that action at this time.
0 commit comments