Comment

Comment by Nullabillity

Docker uses iptables for port forwarding, and those rules typically end up ahead of the rules inserted by your firewall (firewalld/ufw/manual scripts/whatever).

It's not so much that they explicitly open a firewall rule, as that they take a networking path that isn't really covered by traditional firewalls.

Another way of viewing it is that Docker "is" your firewall for your container workloads, and that adding a port-forward is equivalent to adding a firewall rule. Of course, that doesn't change that public-by-default is a bad default.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton