Yes it's user error, but it's also a nasty trap for users who are not careful. And it hurts the most, where people are most likely to make the mistake (developers need to publish ports to access local containers on their development machines, but must take care not to do so when deploying to production).
Use `docker network` or the equivalent in the docker-compose file. Not taking time to think about how the software works is not the fault of the software.
The scope of Docker and nginx are incomparable, so the comparison is wrong.
It starts with the simple truth: `docker` doesn't `listen` on any port.
Or maybe a simple question: How can I run `docker run -p 8080 nginx` over and over without port conflict?
Or - lets expand scope even more. How is docker supposed to know about your choice of firewall? What about upstream firewalls? What about multiple versions of firewalls on a host (ufw vs. fern vs.)?
Just tried this because I usually use docker with k8s or compose, so wasn't sure of the behavior.
> It starts with the simple truth: `docker` doesn't `listen` on any port.
If I run the command below, `docker-proxy` starts listening on an incrementing port.
> Or maybe a simple question: How can I run `docker run -p 8080 nginx` over and over without port conflict?
Because you're not specifying a port on the host; you're specifying a port on the container. I've never used the single port form of `-p`; I would've guessed it was the same as `-p 8080:8080`.