Docker Community Forums

Share and learn in the Docker community.

When to use --network=host


(Yaofei) #1

Hi,
I wonder what are the right use-cases for using “host” network driver, because you can expose the ports to Docker host without it?

What’s the pros/cons of using host networking? or not recommended at all for production since the network namespace is not isolated from Docker host.

For example, I want to run 3 Elasticserach Dockers on 3 different VMs in cloud. The VM gives you one private IP and one public IP that you can reach from Internet.

What I realized that if I don’t use network_mode: ‘host’ I cannot reach the cluster at all.

Any advice appreciated!