1. What to use Networking for?
- For enabling communication between containers, as well as between containers and outside world. Docker container are typically isolated environments, and networking allow them to interact with each other and with external resources.
2. How to use Networking?
- Create Network
- Run container attached to Network
- Communicate between containers: Container attached to the same network can communicate will each other using their container names or service name of container. For example, if you have another container attached to 'my-network' name container2, then 'container1' can communicate with 'container2' using its name.
- Host communicate with containers: Expose ports to the host, then host can access to container through port.
3. What does Networking include?
- Alias: To assigns additional hostnames (aliases) to a container within specific Docker network. These aliases allow other containers within the same network to communicate with the container using those hostnames.-------------------------
Detailed instructions
No comments:
Post a Comment