Podman Compose Error when resolve instance hostname in same pod on RHEL 8.8 : Change the network_backend

So, this is another story or experience that I gain when I wrote my last piece of exercise in University Lab. I have subset of running container compose in Internet Server Administration courses, and one of my assistant told me that podman-compose on nginx-golang (one of the container set up from https://github.com/docker/awesome-compose/tree/master/nginx-golang for learning proxy), aren’t working. I’m curious, so I spin same env as the student has.

Surprisingly, it is broken, the nginx in front of golang instance, can’t detect backend hostname. Usually this works on podman, and the thing I forgot, when I tried it before releasing this exercise, I don’t test it same as lab environment using RHEL 8.8. I tested it on Fedora 38, on my Thinkpad. So I spin a RHEL clones, 8.8, and the result are surprisingly same, it’s broken, but not in Fedora. I also tried on RHEL 9.2, surprisingly it’s working. So I inspect the container, I found different interface name and network backend. I remember since podman 3 or 4, it’s already moved to netavark, so I’m sure that I don’t need to check anything.

I asked some folk in #podman@libera.chat (<afbjorklund[m]>, it’s matrix bridge), and he point me back to my hypothesis, that probably need to use different network backend (CNI or netavark). He told me to use “podman-plugins” package, but to no avail, it’s broken, and I remember that the network backend still is CNI, so I change it, rerun the compose, still broken… it says there are no binary

Error: could not find "netavark" in one of [/usr/local/libexec/podman /usr/local/lib/podman /usr/libexec/podman /usr/lib/podman]. To r
esolve this error, set the helper_binaries_dir key in the [engine] section of containers.conf to the directory containing your helper

So I check using dnf search, and I found the netavark package, the install it. In short, we need to do install podman-plugins and netavark, then change the backend to netavark in containers.conf, then done, rerun the podman-compose, it will work as it’s. You can do as follows :

$ sudo dnf install podman-plugins netavark -y
$ sudo vim ~/.config/containers/containers.conf
#### add these lines if it's not exist
## [network]
## network_backend="netavark"

I hope this help some folks that face same problem as I faced.

By ben

I'm a geeks. Just look at my website :)

Leave a Reply. I will come back and maybe we can have some conversation :)

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: