Docker Networking: Bridges, DNS, Reverse Proxy A developer published a guide to restructuring Docker networking for large, multi-service AI systems, arguing that non-deterministic LLM outputs chained across services require locally perturbing and testing the whole pipeline end-to-end. The guide covers Docker's default bridge network (host interface docker0 at 172.17.0.1), veth pairs, port publishing via `docker run -p`, and the host-port collision that occurs when a second container tries to bind 0.0.0.0:3000, which the author resolves by mapping host port 4000 to container port 3000. The author, who describes themselves as not a networking or security engineer, notes that `-p 3000:3000` listens on 0.0.0.0 and bypasses host firewall rules such as ufw on Linux, recommending `-p 127.0.0.1:3000:3000` instead. Docker Networking: Bridges, DNS, Reverse Proxy Preview I’ve revamped my entire docker networking setup for working with very large and complex end-to-end systems that chain multiple services together each running in their own docker networks, subnetworks and containers. Pre AI LLM era, it may have been sufficient to just guarantee the output of your service. However these days, that operational model no longer holds when the output of your service is a non-deterministic response, which will in turn be ingested by another non-deterministic system and have cascading effects. Thus we need to be able to perturb various parts of the system and study the whole chain end-to-end locally. At the end of the day, we want 1. to enable M x N way connections across containers, 2. have these dynamically updated whenever we add a new service enabling smooth A/B testing, 3. avoid stomping on each other’s host ports 4. avoid calling the wrong service due to changing IP addresses. Disclaimer: I’m no networking or security engineer, though I did muck around with devops and dockerfiles by hand before LLM era. This is not a suggestion on how to organise production networks. All diagrams and writing in this post are fully human, but fact-checked with AI. Single service stack, single port There are two ways to start a service stack: docker run , and docker compose . run and compose both run images, with run typically relying on CLI flags and compose being a declarative config file. Both are flexible enough to work for either single or multiple services. run is typically used for one-off containers, whereas compose is favored for multi-container lifecycle. The latter also creates a user-defined network by default which has DNS - but more on that later. In docker, if you did docker run appA , the containers will get created in the default bridge network whose host-side interface is docker0 . A command like docker run -p