Tag: container

Podman containers can’t talk to each other

The other day I decided to update my server-side rendering example, and I ran into a strange problem. While my compose.yaml hasn’t changed, my containers could not talk to each other. This was most apparent with the nginx container, which immediately crashed out with [emerg] 1#1: host not found in upstream. What gives?

After a quick debugging including on a different computer, it became clear that my compose.yaml should be fine: it worked without issues on the computer that used Docker, but didn’t work with Podman. The issue with Podman was soon clear too: looking at podman network inspect the "dns_enabled": false was an obvious culprit. That’s where things got interesting.


Migrating from Docker to Podman

I’ve been eyeing Podman for a while. Being able to build and run containers without the Docker daemon hanging around in the background as an omnipotent demigod sounds nice. Less stuff running = good. Installing it is trivial on Ubuntu (unlike installing Docker): apt-get install podman and it’s done. As the documentation states, it can even be aliased to docker to make migration even smoother. It has tons of features that I don’t think are there in Docker: generating Kubernetes YAMLs from running containers, using container LABELs to make run commands simpler and so on.

Which is all nice and it’s to stay for sure, but I had to realize that at this point this won’t have much of an effect on me (anymore). I hardly ever build container images locally, instead using some CI (Github Actions) to do it automatically. Not having to remember all the build options (even if just in .bash_history) is nice, and if I have to put it into code anyway, I might as well automate it completely.

As for running containers, podman run will be now my go-to for experimentation (instead of docker run). However, most of the time I use docker-compose to orchestrate a local development environment. It’s possible to use Podman’s system service to use docker-compose, but then is there much of a difference from running that and having the Docker daemon running? It’s also possible to use (simple) Kubernetes Pod/Service YAMLs to achieve something similar, and I’ll be sure to consider that the next time. But I don’t think I’ll make the effort to change these stuff for existing projects on my current computer. Not unless Docker kills free users altogether…