Differences between revisions 2 and 6 (spanning 4 versions)
Revision 2 as of 2021-11-18 21:36:05
Size: 565
Comment:
Revision 6 as of 2023-04-04 20:10:24
Size: 822
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]]. `dockerd(8)` manages the network for all containers.

The networking model is tightly coupled to `iptables(8)`.
Line 11: Line 13:
== Default Network == == Bridge Networks and the Default Network ==
Line 13: Line 15:
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'''. Furthermore, if a bridge network is not specified, the special '''default network''' is used. For more information on all of these, see [[Docker/BridgeNetworks|here]].
Line 19: Line 21:
== Creating Networks == == Disabling ==
Line 21: Line 23:
To disable networking for a container, try:
Line 22: Line 25:

=== Name Resolution ===
{{{
docker run \
  --network=none \
  hello-world
}}}
Line 31: Line 37:
To attach a container to the host's own network, try:

{{{
docker run --detach --name my-haproxy \
  --network=host \
  haproxy:latest
}}}

Docker Networking

dockerd(8) manages the network for all containers.

The networking model is tightly coupled to iptables(8).


Bridge Networks and the Default Network

The default behavior for a new container is to use a bridge network. Furthermore, if a bridge network is not specified, the special default network is used. For more information on all of these, see here.


Disabling

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


CategoryRicottone

Docker/Networking (last edited 2023-04-04 20:10:24 by DominicRicottone)