Home Camera Settings Quadlet is the key tool that makes Podman better than Docker, and...

Quadlet is the key tool that makes Podman better than Docker, and here’s how to use it

10
0


With its easy-to-use nature and rock-solid ecosystem, Docker has been my constant companion during the course of my home lab journey. But after trying out Podman earlier, I’ve switched entirely to the daemonloss, rootless container runtime. Besides offering better security, Podman also brings pod support to the table, making it perfect when you want to host closely associated services on your production-grade workstation.

Better yet, you can arm your Podman system with a couple of neat additions. This includes Quadlet, a utility that lets you run containers as though they were systemd services. If that sounds interesting, then read on. Here’s a quick article to help you get up to speed on Quadlet.

Related

The definitive roadmap for your self-hosting journey

Want to dive into the self-hosting rabbit hole but don’t know where to start? We’ve come up with the perfect roadmap for you!

What’s Quadlet, anyway?

And why should you bother using it?

Deploying IT-Tools as a systemd container using Quadlet

Before we can discuss Quadlet, it’s time to go over systemd. For the uninitiated, systemd is the service manager that handles the execution of programs when you start your Linux machine. By default, Podman uses the fork-exec model for running your containers, but you can use Quadlet to deploy your containerized services under systemd. While it may sound somewhat complex, there are a couple of benefits to treating your Podman-based apps as system services.

For one, you can use Quadlet to auto-update your container suite. You can use systemd tools to receive the container logs as well as receive notifications if a service goes offline out of nowhere. Throw in the facility to auto-boot containers and restart them upon failure, and it’s clear why many home lab enthusiasts prefer Quadlet.

That’s before you include the support for custom container configuration files. While I wouldn’t say it can entirely replace Docker Compose, Quadlet is a rock-solid alternative if you want to use declarative config documents when creating containers in Podman.

Related

I use Podman Desktop to manage my container fleet on Windows – here’s how you can, too

Looking for a daemonless alternative to Docker? You’ll love Podman Desktop

Setting up Quadlet

As with every other home lab utility, there are a couple of ways you can integrate Quadlet into your workflow. Podman Desktop offers the simplest method for installing Quadlet, and the overall process is the same regardless of whether you’re using the Windows 11 and WSL2 combo or have a Linux system. Assuming you’ve already configured Podman Desktop and grabbed some container images for the Quadlet,

  1. Launch Podman Desktop and switch to the Extensions tab.

    Selecting the Extensions tab in Podman Desktop

  2. Navigate to the Catalog sub-menu and press the Install button adjacent to the Podman Quadlet extension.

    Selecting the Podman Quadlet extension in Podman Desktop

  3. Click on the freshly-installed Quadlets extension and hit the Generate Quadlet option.

    Generating a Quadlet in Podman Desktop

  4. Choose your local Podman machine as the Container engine, pick Image as the Quadlet type, and select the Image you wish to use for the new container before tapping Generate.

    Choosing the Quadlet settings

  5. Ensure that the configuration file has the correct parameters for your new container and click the Load into machine button.

    Generating a Quadlet using its config

  6. Depending on your system specs and the image chosen, Quadlet will take some time to deploy a new container.

    Creating a Quadlet in Podman Desktop

If you’re on a CLI Linux distribution, you can create an app_name.container configuration file inside the etc/containers/systemd directory, reload systemd with the systemctl –user daemon-reload command, and use the systemctl –user start app_name.service command to start the container.

Enhance your Podman + Quadlet setup with even more utilities

If you’re used to Docker Compose’s YAML syntax, Quadlet’s layout may seem rather jarring. Podlet can help convert docker-compose.yml files into their equivalent Quadlet code, though you may need to edit the final result as Podlet is far from infallible. Once you’ve gotten the hang of Quadlet, you can combine it with Kubernetes to create an imposing self-hosting workstation. I recommend checking out the Minikube and Kreate extensions if you’re on Podman Desktop and want to dive into the K8s rabbit hole.

Related

Should you use Kubernetes in your home lab?

If you like tinkering with containers or want some invaluable learning experience, Kubernetes will be a worthy addition to your experimentation server



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here