Objective

Understand Docker networking modes and configure container communication.

Tools & Technologies

  • Docker
  • bridge
  • overlay
  • macvlan

Key Commands

docker network create mynet
docker run --network mynet myapp
docker network inspect bridge
docker run -p 8080:80 nginx

Lab Steps

01
Bridge Networks

Create custom bridge networks for container isolation.

02
Port Mapping

Map container ports to host ports for external access.

03
Container DNS

Understand how containers resolve each other by name on custom networks.

04
Network Inspection

Inspect networks to understand IP assignment and connected containers.

Challenges Encountered

  • Default bridge network doesn't support DNS resolution by name
  • Host network mode bypasses all isolation

Key Takeaways

  • Always use custom bridge networks — default bridge has limitations
  • Overlay networks are required for multi-host Docker Swarm communication