简体   繁体   中英

What is the difference between exposing docker port and creating bridge(or overlay)?

I've started to work with Docker recently, so the question might be strange. The point is that I need to deploy cluster using containers and my main concern is next: what will be more suitable - just to expose ports of all containers to the machine's ports or to use bridge(or overlay)?

Port exposing is intended to communicate docker container cluster with the outside .

Docker network is intended to communicate docker containers with each other inside of the cluster.

Therefore this is bad practice to communicate containers with each other via port exposing to host machine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM