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:
- host mode, --net = host specified
- container mode, --net = container: NAME_or_ID specified
- none mode, specified --net = none
- 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