Monday, July 27, 2020

Docker Network

Description: Here I have explain what is docker network, types and use of different network

What is Docker Network?
Docker Network is use for communication between 2 different container and from host machine.

Types Of Docker Network:
Three types of Docker Network
  1. Bridge
  2. none 
  3. host
Bridge Mode: By default this mode enable for all container and they communicate with each other using private IP Address. Generally it is from 17.17.0.0 network, if you want to access from outside you need to map port number with host server. When you run any container  default bridge mode is enable.

# docker run ubuntu

None Mode: If you don't want to assign external access in container then you can use none mode. This mode will isolate your network. You can enable by using below command

# docker run ubuntu --network=none


Host Mode:  If you want to use port number directly from container rather than map with host server. You can use host mode. Your application on container directly access from container rather than docker server. You can enable using below command.

# docker run ubuntu --network=host


1 comment: