By default, Docker Engine connects container via a default bridge to the network of the node. However, only overlay networks in a Swarm context let containers communicate further than the nodes network boundaries. In special cases, own bridge networks can be added to i.e. allow for communication only between two special containers.
How to connect two containers via a private bridge