Skip to content

templates: add new template for podman on ubuntu lts #3721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions templates/podman-ubuntu-lts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# A template to use Podman on Ubuntu instead of containerd & nerdctl
# $ limactl start ./podman-ubuntu-lts.yaml
# $ limactl shell podman podman run -it -v $HOME:$HOME --rm docker.io/library/alpine

# To run `podman` on the host (assumes podman-remote is installed):
# $ export CONTAINER_HOST=$(limactl list podman --format 'unix://{{.Dir}}/sock/podman.sock')
# $ podman --remote ...

# To run `docker` on the host (assumes docker-cli is installed):
# $ export DOCKER_HOST=$(limactl list podman --format 'unix://{{.Dir}}/sock/podman.sock')
# $ docker ...

minimumLimaVersion: 1.1.0

base:
- template://_images/ubuntu-lts
- template://_default/mounts

containerd:
system: false
user: false
provision:
- mode: system
script: |
#!/bin/bash
set -eux -o pipefail
command -v podman >/dev/null 2>&1 && test -e /etc/lima-podman && exit 0
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y podman && touch /etc/lima-podman
- mode: user
script: |
#!/bin/bash
set -eux -o pipefail
systemctl --user enable --now podman.socket
probes:
- 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
hint: See "/var/log/cloud-init-output.log" in the guest
portForwards:
- guestSocket: '/run/user/{{.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:
------
podman system connection add lima-{{.Name}} "unix://{{.Dir}}/sock/podman.sock"
podman system connection default lima-{{.Name}}
podman{{if eq .HostOS "linux"}} --remote{{end}} run quay.io/podman/hello
------
Loading