Interview Prep/Docker/Networking and Compose

When would you use `--network host`?

IntermediateScenarioNetworking and Compose
Answer

Situation read → Needs maximum network performance or many dynamic ports.

What I'd do → Use it for packet capture tools, node-level monitoring agents or high-throughput proxies on Linux. Do not combine with -p; those flags are ignored.

Why → Skips NAT and veth overhead, but port conflicts with the host are possible and the container sees all host interfaces.

Interview tip → It does not work the same on Docker Desktop (VM boundary).

All Docker questions Roadmap: Docker & containers

More on Networking and Compose