How do Docker network modes differ?
IntermediateConceptKubernetes, Containers, MTU & Performance Basics
Answer
bridge (default): containers on a private NAT'd bridge (docker0). host: shares the host's network stack, no isolation or port mapping. none: loopback only. overlay: multi-host networking for Swarm. macvlan: gives containers their own MAC and LAN IP.
Port publishing (-p 8080:80) creates DNAT rules in iptables; user-defined bridges also give automatic DNS between containers by name.
More on Kubernetes, Containers, MTU & Performance Basics
What are the basic Kubernetes networking rules?BeginnerWhat are the Service types in Kubernetes?BeginnerWhat is the difference between a Service and an Ingress?BeginnerHow does kube-proxy implement Services?AdvancedHow does DNS work for Services and pods in Kubernetes?IntermediateWhat is a CNI plugin and how do the main ones differ?Intermediate