Problem Statement
When multiple containers run on the same or different hosts, they need to communicate reliably. Without proper networking, containers cannot discover each other or exchange data, causing service failures and poor scalability.
Jump into concepts and practice - no test required
This diagram shows containers on different hosts connected via virtual and overlay networks, enabling cross-host container communication.
mynet?docker network create <name>.web and db connected on a user-defined network mynet, what happens when web tries to ping db by container name?mynet, web can ping db by name successfully.api service to communicate with db. Which design best achieves this?api to both networks allows it to talk to db while others cannot.api-net and db-net. Connect api to both networks, db only to db-net. isolates db and allows only api access. Other options either lack isolation or allow unwanted access.api-net and db-net. Connect api to both networks, db only to db-net. -> Option D