網路機制
1.3.1 Default Network Modes
$ docker network ls
NETWORK ID NAME DRIVER
7fca4eb8c647 bridge bridge
9f904ee27bf5 none null
cf03ee007fb4 host host
Bridge (default)
Containers in this default network are able to communicate with each other using IP addresses. The default docker0 bridge network supports the use of port mapping anddocker run --link to allow communications between containers in thedocker0 network.
None
The none network adds a container to a container-specific network stack. That container lacks a network interface
Host
container內網路同Host一樣(共用)
1.3.2 Used-Defined Network
Create bridge network
# docker network create my_bridge # docker network ls
Create overlay network
Docker's overlay network driver supports multi-host networking natively out-of-the-box.
The overlay network requires a valid key-value store service