docker networks (c)

docker4 kinds of network 

When docker run to create a container-based, you can use the option to specify the container --net network mode: Docker default mode network has the following four:

  1. host mode, --net = host specified
  2. container mode, --net = container: NAME_or_ID specified
  3. none mode, specified --net = none
  4. bridge mode, --net = bridge is specified, the default settings

bridge network topology model as follows:

 

 

host network topology model as follows:

 

 container network topology model as follows:

 

 Port Mapping

The first random mapping

docker run -p PORT 

The second specified map

-p hostPort:containerPort
-p ip:hostPort:containerPort
-p ip::containerPort
-p hostPort

 

                                                               

Guess you like

Origin www.cnblogs.com/fengzi7314/p/11921162.html