Docker
/Beginner
Docker Networking Basics
Definition
The subsystem that allows isolated Docker containers to communicate with each other, with the host machine, and with the outside internet, without compromising their security isolation.
Explain Like I'm New
Plugging ethernet cables into the boxes. Without networking, a container is completely deaf and blind. With networking, containers can talk to the database, and humans can talk to the web server.
Real World Example
You spin up a WordPress container and a MySQL container. Out of the box, they cannot see each other. You must attach both of them to a virtual 'Docker Network' so WordPress can send data to the database.
Common Use Cases
- •Microservices communication
- •External access
Interview Questions
basic
- By default, if you start a container, can it access the public internet (e.g., to download a file)?
intermediate
- By default, can two completely random containers talk to each other by their container names?