How to use the host network, and any other user-defined network together in Docker-Compose?
I want to connect two Docker containers, defined in a Docker-Compose file to each other ( app and db ). And one of them ( app ) should also be connected to the host network. The containers should be connected to a common user-defined network ( appnet or default ) to use the embedded DNS capabilities from docker networking. app needs also to be directly connected to the host network to receive ethernet broadcasts (network layer 2) in the physical network of the docker host. If I use both directives network_mode: host and networks in compose together, I get the following error. ERROR: 'network