Size: 565
Comment:
|
Size: 560
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
For information on bridge networks between containers, see [[Docker/BridgeNetworks|Bridge Networks]]. | |
Line 11: | Line 10: |
== Default Network == | == Container Networking == |
Line 13: | Line 12: |
All containers are attached to a network. If one is not specified, the default network is used. This network is special in that there is no name resolution; the only way to communicate between containers is their ephemeral IP addresses. | The default behavior for a new container is to use a bridge network. For information on bridge networks, see [[Docker/BridgeNetworks|Bridge Networks]]. |
Line 15: | Line 14: |
---- | To disable networking for a container, try: {{{ docker run \ --network=none \ hello-world }}} |
Line 19: | Line 24: |
== Creating Networks == | === Host Network === |
Line 21: | Line 26: |
To attach a container to the host's own network, try: | |
Line 22: | Line 28: |
=== Name Resolution === ---- == Host Network == |
{{{ docker run --detach --name my-haproxy \ --network=host \ haproxy:latest }}} |
Docker Networking
Container Networking
The default behavior for a new container is to use a bridge network. For information on bridge networks, see Bridge Networks.
To disable networking for a container, try:
docker run \ --network=none \ hello-world
Host Network
To attach a container to the host's own network, try:
docker run --detach --name my-haproxy \ --network=host \ haproxy:latest