Running container with Podman Quadlet

Up until recently, my preferred method of creating Podman containers is to use Ansible, and that has been working fine for me. However, I just stumble the new-to-me method called “quadlet”. So far, I really like it, and already started moving some containers to quadlet. To learn more about Quadlet, check out [1]. But, today I’m going to share an example of creating a simple container with Quadlet. In this example, the container whoami is run in rootless mode, under a non-privileged user....

December 17, 2024 · 2 min · 312 words · kenno

Accessing host from inside Podman 5.0 container

Sometimes you need to connect to the host from a Podman container running on it. How would you do that? In the past I was able to get this working by connecting to the gateway IP of the container. For example, I have a web server running on the host listening on port 8080. ➜ nc -vz localhost 8080 Ncat: Version 7.92 ( https://nmap.org/ncat ) Ncat: Connected to 127.0.0.1:8080. Ncat: 0 bytes sent, 0 bytes received in 0....

December 2, 2024 · 2 min · 420 words · kenno

Fix container to container DNS lookup failed in Podman OpenSUSE Leap 15.16

I’ve started to running more containers in my homelab with Podman, running inside AlamaLinux. Most of the times, things just worked. However today, I tried to setup similar containers on OpenSUSE Leap 15.16 host, and I came across an issue getting containers to communicate with one another. Well, spoiler alert, I found a solution, hence this blog post. TL;DR - install cni-plugin-dnsname package from cni-plugin-dnsname build service. (No package from the official OpenSUSE repo)....

November 11, 2024 · 3 min · 572 words · kenno

How to force kill a Podman container

There is a container that I cannot stop. TL;DR the solution that worked for me was rebooting the host system. Anyhow, I’ll share the troubleshooting steps that did not work. ❯ podman stop semaphore-postgres WARN[0010] StopSignal SIGINT failed to stop container semaphore-postgres in 10 seconds, resorting to SIGKILL Error: given PID did not die within timeout ❯ podman ps -a | grep semaphore-postgres a688a42c4c15 docker.io/library/postgres:16 postgres 17 minutes ago Stopping 0....

July 7, 2024 · 2 min · 305 words · kenno

How to use auto-update in Podman

I have a Podman container that needs periodically manual update once in a while. I’d like this container to auto-update, and found that this was possible with podman auto-updates feature. Essentially, I need to set a label for the container - --label io.containers.autoupdate=registry. More details with and very good explanation about this topic is available at a Red Hat Enable Sysadmin article titled “How to use auto-updates and rollbacks in Podman”....

June 15, 2024 · 2 min · 378 words · kenno

How to Run Redis in Podman Container

This is just a quick note on how to run Redis as a container using Podman on Ubuntu 22.04 (i.e. there will be no mention about SELinux.) Create a persistent volume for the Redis container I like storing all data/volume for containers under /srv/data. So I’ll create a sub-directory called redis-data under the same location. # mkdir -p /srv/data/redis-data Pull the Redis image # podman pull docker.io/redis Create and run the Redis container # podman run -d --name redis_server \ -v /srv/data/redis-data:/var/redis/data \ -p 6379:6379 redis Create systemd service for the Redis container I like creating a systemd service to enable/start the container....

February 22, 2023 · 1 min · 189 words · kenno