Docker-compose networking in Fedora 32

EDIT <2020-04-29 Wed>: Someone kindly contributed a nicer solution to this:

Hope this helps. I had the same issue, and this fixes it. Just set firewalld back to iptables.

https://pastebin.com/Zq3Gev7w

I recently upgraded to the Fedora 32 Beta release. I've had a great time so far but there is one minor pain point that took me a bit of time to figure out: Docker Compose containers can't talk to each other anymore.

After a bit of research it turns out the answer is simple: Fedora is now defaulting to nftables for firewalld1. Don't ask me what that actually means, I have no idea. Until then, that is why Docker Compose containers aren't able to talk to each other: the new format of these firewall rules is not observed by Docker, so therefore the traffic is blocked even within the containers.

The only solution I've found for the moment is temporarily disabling firewalld which isn't ideal at all but I couldn't see anything else to it - the other solution seemed to be manually adding specific ports2.

Another article3 suggests that restarting docker after firewalld writes its rules would do the trick but that didn't do it either on my system.

So in the meantime I just disable firewalld with systemctl, until something better comes up.

See also: https://github.com/firewalld/firewalld/issues/461.

Footnotes:

Created: 2020-04-29 Wed 09:54