Comment by szszrk

6 hours ago

How do you manage your containers in podman declaratively?

I tried to substitute docker-compose with Podman and Quadlets on a test server the other day, but was shocked how badly described the overall concept is. Most materials I found glimpsed through ability to run it as root/user and how different that is in configuration, and repeated the same 4-6 commands mantra.

Spent a few hours on it and just... failed to run a single container. systemctl never noticed my qualdet definitions, even if podman considered my .container file registered.

A bit.. frustrating, I expected smoother sailing.

This has also been my experience, I'm used to using compose everywhere. I like the declarative file - tried podman and I found the documentation around the concept so scarce and all related to running things as non-root instead of telling me how my docker-compose becomes podman-compose. Still using docker everywhere because of that. Docker swarm mode has also worked wonders as an evolution to my compose files.

  • I know podman-compose, have some homelab services running on it for a few years, but honestly found multiple ones that failed. It's far from drop-in replacement.

The podman kube support? It provides similar functionality as docker-compose, using a yaml file which is a subset of the Kubernetes pod definition syntax.

Then you can just create a few line systemd unit definition, and it integrates as a normal systemd unit, with logs visible via journalctl etc.

  • This seems to be the way.

    Short of weeding through the docs, I found the "Play with Kube using Podman" talk on DevConfs YouTube channel helpful.

    • I will be honest: that is even more confusing :)

      > Note: The kube commands in podman focus on simplifying the process of moving containers from podman to a Kubernetes environment and from a Kubernetes environment back to podman.

      I'll give it a try, but I'm starting to understand why there is so little use of podman among amateurs.

      1 reply →

Podman supports Compose files, so there's that. I've only glimpsed at Quadlets and I agree they seem very esoteric, especially if you're not very well versed in systemd service definitions.

Yeah I think Quadlet just has bad docs. They document the whole API but iirc there is no: ok this is the hello world for running cowsay as a systemd unit

quadlets fully depend on systemd doing its work. So, assuming you are running rootless, if you change your quadlets, you will need

  systemctl --user daemon-reload

to let systemd ingest the changes. And, if you have configured to start your container on boot, then still you have to start the container by hand, as you typically won't reboot during development. If you have multiple containers, it might be easiest to have them in one pod, so you only need to start the pod.

I agree that the documentation needs a good tutorial to show the complete concept as a starting point. There are multiple ones though on the internet.

  • yeah, that's exactly what every tutorial says. And I know systemd more or less, daemon-reload is no stranger to me.

    That was not sufficient. Both for global o user setup.