containers / podman-desktop

Podman Desktop is the best free and open source tool to work with Containers and Kubernetes for developers. Get an intuitive and user-friendly interface to effortlessly build, manage, and deploy containers and Kubernetes — all from your desktop.
https://podman-desktop.io
Apache License 2.0
4.68k stars 296 forks source link

Examples: Be able to use CentOS / RHEL / other operating systems for `podman machine init / start` #1638

Open cdrage opened 1 year ago

cdrage commented 1 year ago

Is your feature request related to a problem? Please describe

When I run podman machine, maybe I'd like to try using RHEL or other operating systems. Instead, I'm stuck using fedora-coreos / running the default podman machine operating system.

Describe the solution you'd like

We should be able to provide instructions / alternatives to try out Podman Desktop against RHEL, RHED, etc.

Describe alternatives you've considered

No response

Additional context

No response

ashley-cui commented 1 year ago

I'd do this with caution, because at the current moment the Podman team can only support FCOS (eventually maybe RHELCOS), and doing a demo on this may give of the impression that we can support other OS's.

baude commented 1 year ago

agree. of all the things required rn, are there not significantly more impactful and import things to do ?

afbjorklund commented 1 year ago

You can use the existing Lima provider, to run other operating systems - such as Fedora (Cloud)

The instance name is currently hardcoded ("podman-lima"), but you can use any template://

EDIT: In v1.0.1, the hardcoded instance name was changed from "podman-lima" to just "podman".

limactl start template://podman

EDIT: In v1.1.0, it is not hardcoded anymore - but available in preferences


If you choose another template (than podman), you have to install podman on the machine yourself

You can see how podman does it: https://github.com/lima-vm/lima/blob/master/examples/podman.yaml

And follow the upstream podman instructions: https://podman.io/docs/installation#installing-on-linux

limactl start --name podman template://centos-stream

afbjorklund commented 1 year ago

Lima

Using CentOS Stream instead of the default Fedora Cloud, causes the image download to be twice as big:

475M    https://download.fedoraproject.org/pub/fedora/linux/releases/38/Cloud/x86_64/images/Fedora-Cloud-Base-38-1.6.x86_64.qcow2
1.1G    https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-20230523.0.x86_64.qcow2

I'm not sure why this is, but it is still smaller than CoreOS (the download is 627M, but decompresses to 1.6G!)

646M    .local/share/containers/podman/machine/qemu/fedora-coreos-38.20230806.2.0-qemu.x86_64.qcow2.xz
1,6G    .local/share/containers/podman/machine/qemu/podman-machine-default_fedora-coreos-38.20230918.2.0-qemu.x86_64.qcow2

No public templates available for RHEL

But these distributions are available:


There is also Alpine.

There is an Alpine image available as an alternative, it weighs in at 98M - but it doesn't do rootless (no systemd) https://github.com/afbjorklund/lima/blob/nerdcore/examples/alpine-podman.yaml (currently slightly out of date) It is just the `template://alpine`, with the latest `podman` pre-installed from the latest distro package available: https://pkgs.alpinelinux.org/packages?name=podman&branch=edge&repo=community (`apk add podman`) EDIT: Here are some ready-to-run examples, using the regular ISO: https://github.com/afbjorklund/lima/tree/alpine-examples/examples
afbjorklund commented 1 year ago

Added template for Fedora CoreOS to Lima, adding ignition support to the cloud-init support:

limactl start --name podman template://fedora-coreos

limactl start --name docker template://fedora-coreos

It doesn't have the portForward by default, so that YAML needs to be added to the configuration.

But all of podman and docker and nerdctl are already installed, by the default installation here.

portForwards:
- guestSocket: "/run/user/{{.UID}}/podman/podman.sock"
  hostSocket: "{{.Dir}}/sock/podman.sock"
afbjorklund commented 9 months ago

More examples, for Ubuntu and AlmaLinux: (you can probably make your own "remix")

https://github.com/afbjorklund/lima/tree/podman-desktop/examples/podman-desktop

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had activity in the last 6 months. It will be closed in 30 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!