In docker, links helps container find each other with name. Can we achive this b . . .

aayush gupta:
In docker, links helps container find each other with name. Can we achive this by making a network and putting all the containers in it because inside the same network containers can find each other ?? Taking example of voting application ( docker compose section).

Mukund Tolay:
Hi Ayush… Yes this approach will definitely work… But what if the container is down because of some reason and then how the network will get to know if that particular container once it up? Ip will be changed once the container is up. That’s why we use container name to identify and link it to one another… I hope this helps…