From 93d373e676a591c6886f9106081c06a8dd4b8aae Mon Sep 17 00:00:00 2001 From: Stephanie Aurelio <133041642+stephaurelio@users.noreply.github.com> Date: Thu, 26 Oct 2023 12:58:08 -0700 Subject: [PATCH] freshness updates (#18533) --- content/network/_index.md | 14 +++++++------- content/network/drivers/_index.md | 2 +- content/network/drivers/bridge.md | 14 +++++++------- content/network/drivers/host.md | 17 ++++++++++------- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/content/network/_index.md b/content/network/_index.md index e34b7f5c67d..1c41a860da2 100644 --- a/content/network/_index.md +++ b/content/network/_index.md @@ -1,7 +1,7 @@ --- title: Networking overview -description: How networking works from the container's point of view -keywords: networking, container, standalone +description: Learn how networking works from the container's point of view +keywords: networking, container, standalone, IP address, DNS resolution aliases: - /articles/networking/ - /config/containers/container-networking/ @@ -69,7 +69,7 @@ Here are some examples: If you want to make a container accessible to other containers, it isn't necessary to publish the container's ports. -Inter-container communication is enabled by connecting the containers to the +You can enable inter-container communication by connecting the containers to the same network, usually a [bridge network](./drivers/bridge.md). ## IP address and hostname @@ -79,7 +79,7 @@ A container receives an IP address out of the IP subnet of the network. The Docker daemon performs dynamic subnetting and IP address allocation for containers. Each network also has a default subnet mask and gateway. -When a container starts, it can only attaches to a single network, using the `--network` flag. +When a container starts, it can only attach to a single network, using the `--network` flag. You can connect a running container to additional networks using the `docker network connect` command. In both cases, you can use the `--ip` or `--ip6` flags to specify the container's IP address on that particular network. @@ -106,7 +106,7 @@ configuration. | Flag | Description | | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--dns` | The IP address of a DNS server. To specify multiple DNS servers, use multiple `--dns` flags. If the container can't reach any of the IP addresses you specify, it uses Google's public DNS server at `8.8.8.8`. This allows containers to resolve internet domains. | -| `--dns-search` | A DNS search domain to search non-fully-qualified hostnames. To specify multiple DNS search prefixes, use multiple `--dns-search` flags. | +| `--dns-search` | A DNS search domain to search non-fully qualified hostnames. To specify multiple DNS search prefixes, use multiple `--dns-search` flags. | | `--dns-opt` | A key-value pair representing a DNS option and its value. See your operating system's documentation for `resolv.conf` for valid options. | | `--hostname` | The hostname a container uses for itself. Defaults to the container's ID if not specified. | @@ -123,8 +123,8 @@ against the embedded DNS server. It's rare that the external DNS server is faster than the embedded one. But things like garbage collection, or large numbers of concurrent DNS requests, -can result in a roundtrip to the external server being faster than local -resolution, on some occasions. +can sometimes result in a round trip to the external server being faster than local +resolution. ### Custom hosts diff --git a/content/network/drivers/_index.md b/content/network/drivers/_index.md index f574b55fcf0..175c624a9cc 100644 --- a/content/network/drivers/_index.md +++ b/content/network/drivers/_index.md @@ -1,6 +1,6 @@ --- title: Network drivers overview -description: Overview of Docker network drivers and related concepts +description: Learn the basics of Docker network drivers keywords: networking, drivers, bridge, routing, routing mesh, overlay, ports --- diff --git a/content/network/drivers/bridge.md b/content/network/drivers/bridge.md index 3c07afedd5f..44935896190 100644 --- a/content/network/drivers/bridge.md +++ b/content/network/drivers/bridge.md @@ -15,14 +15,14 @@ In terms of networking, a bridge network is a Link Layer device which forwards traffic between network segments. A bridge can be a hardware device or a software device running within a host machine's kernel. -In terms of Docker, a bridge network uses a software bridge which allows -containers connected to the same bridge network to communicate, while providing -isolation from containers which are not connected to that bridge network. The +In terms of Docker, a bridge network uses a software bridge which lets +containers connected to the same bridge network communicate, while providing +isolation from containers that aren't connected to that bridge network. The Docker bridge driver automatically installs rules in the host machine so that -containers on different bridge networks cannot communicate directly with each +containers on different bridge networks can't communicate directly with each other. -Bridge networks apply to containers running on the **same** Docker daemon host. +Bridge networks apply to containers running on the same Docker daemon host. For communication among containers running on different Docker daemon hosts, you can either manage routing at the OS level, or you can use an [overlay network](overlay.md). @@ -82,7 +82,7 @@ network.** Originally, the only way to share environment variables between two containers was to link them using the [`--link` flag](../links.md). This type of - variable sharing is not possible with user-defined networks. However, there + variable sharing isn't possible with user-defined networks. However, there are superior ways to share environment variables. A few ideas: - Multiple containers can mount a file or directory containing the shared @@ -219,7 +219,7 @@ recommended for production use. Configuring it is a manual operation, and it has If you do not specify a network using the `--network` flag, and you do specify a network driver, your container is connected to the default `bridge` network by default. Containers connected to the default `bridge` network can communicate, -but only by IP address, unless they are linked using the +but only by IP address, unless they're linked using the [legacy `--link` flag](../links.md). ### Configure the default bridge network diff --git a/content/network/drivers/host.md b/content/network/drivers/host.md index 7ede367e6ed..dba423e6d18 100644 --- a/content/network/drivers/host.md +++ b/content/network/drivers/host.md @@ -1,14 +1,14 @@ --- title: Host network driver description: All about exposing containers on the Docker host's network -keywords: network, host, standalone +keywords: network, host, standalone, host mode networking aliases: - /network/host/ --- If you use the `host` network mode for a container, that container's network -stack is not isolated from the Docker host (the container shares the host's -networking namespace), and the container does not get its own IP-address allocated. +stack isn't isolated from the Docker host (the container shares the host's +networking namespace), and the container doesn't get its own IP-address allocated. For instance, if you run a container which binds to port 80 and you use `host` networking, the container's application is available on port 80 on the host's IP address. @@ -16,7 +16,7 @@ address. > **Note** > > Given that the container does not have its own IP-address when using -> `host` mode networking, [port-mapping](overlay.md#publish-ports) does not +> `host` mode networking, [port-mapping](overlay.md#publish-ports) doesn't > take effect, and the `-p`, `--publish`, `-P`, and `--publish-all` option are > ignored, producing a warning instead: > @@ -24,9 +24,12 @@ address. > WARNING: Published ports are discarded when using host network mode > ``` -Host mode networking can be useful to optimize performance, and in situations where -a container needs to handle a large range of ports, as it does not require network -address translation (NAT), and no "userland-proxy" is created for each port. +Host mode networking can be useful for the following use cases: + +- To optimize performance +- In situations where a container needs to handle a large range of ports + +This is because it doesn't require network address translation (NAT), and no "userland-proxy" is created for each port. The host networking driver only works on Linux hosts, and is not supported on Docker Desktop for Mac, Docker Desktop for Windows, or Docker EE for Windows Server.