Default Bridge vs User Network
Two containers started with plain docker run (no --network) can't reach each other by container name, but they can in a Compose project. Why?
docker run
--network
Choose one answer
Compose adds every container name to the host's /etc/hosts file.
/etc/hosts
Only user-defined networks resolve container names; the default bridge doesn't.
bridge
Name resolution requires --privileged outside of Compose.
--privileged
Containers started with docker run are never allowed to talk to each other directly.