@@ -900,7 +900,8 @@ options:
900900 - option : rm
901901 value_type : bool
902902 default_value : " false"
903- description : Automatically remove the container when it exits
903+ description : |
904+ Automatically remove the container and its associated anonymous volumes when it exits
904905 details_url : ' #rm'
905906 deprecated : false
906907 hidden : false
@@ -1189,14 +1190,7 @@ examples: |-
11891190 2. Install `htop` in the container:
11901191
11911192 ```console
1192- / # apk add htop
1193- fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/aarch64/APKINDEX.tar.gz
1194- fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/aarch64/APKINDEX.tar.gz
1195- (1/3) Installing ncurses-terminfo-base (6.4_p20230506-r0)
1196- (2/3) Installing libncursesw (6.4_p20230506-r0)
1197- (3/3) Installing htop (3.2.2-r1)
1198- Executing busybox-1.36.1-r2.trigger
1199- OK: 9 MiB in 18 packages
1193+ / # apk add --quiet htop
12001194 ```
12011195
12021196 3. Invoke the `htop` command.
@@ -1682,7 +1676,24 @@ examples: |-
16821676
16831677 To start a container and connect it to a network, use the `--network` option.
16841678
1685- The following commands create a network named `my-net` and adds a `busybox` container
1679+ If you want to add a running container to a network use the `docker network connect` subcommand.
1680+
1681+ You can connect multiple containers to the same network. Once connected, the
1682+ containers can communicate using only another container's IP address
1683+ or name. For `overlay` networks or custom plugins that support multi-host
1684+ connectivity, containers connected to the same multi-host network but launched
1685+ from different Engines can also communicate in this way.
1686+
1687+ > **Note**
1688+ >
1689+ > The default bridge network only allows containers to communicate with each other using
1690+ > internal IP addresses. User-created bridge networks provide DNS resolution between
1691+ > containers using container names.
1692+
1693+ You can disconnect a container from a network using the `docker network
1694+ disconnect` command.
1695+
1696+ The following commands create a network named `my-net` and add a `busybox` container
16861697 to the `my-net` network.
16871698
16881699 ```console
@@ -1699,24 +1710,56 @@ examples: |-
16991710 $ docker run -itd --network=my-net --ip=192.0.2.69 busybox
17001711 ```
17011712
1702- If you want to add a running container to a network use the `docker network connect` subcommand .
1713+ To connect the container to more than one network, repeat the `-- network` option .
17031714
1704- You can connect multiple containers to the same network. Once connected, the
1705- containers can communicate using only another container's IP address
1706- or name. For `overlay` networks or custom plugins that support multi-host
1707- connectivity, containers connected to the same multi-host network but launched
1708- from different Engines can also communicate in this way.
1715+ ```console
1716+ $ docker network create --subnet 192.0.2.0/24 my-net1
1717+ $ docker network create --subnet 192.0.3.0/24 my-net2
1718+ $ docker run -itd --network=my-net1 --network=my-net2 busybox
1719+ ```
1720+
1721+ To specify options when connecting to more than one network, use the extended syntax
1722+ for the `--network` flag. Comma-separated options that can be specified in the extended
1723+ `--network` syntax are:
1724+
1725+ | Option | Top-level Equivalent | Description |
1726+ |-----------------|---------------------------------------|-------------------------------------------------|
1727+ | `name` | | The name of the network (mandatory) |
1728+ | `alias` | `--network-alias` | Add network-scoped alias for the container |
1729+ | `ip` | `--ip` | IPv4 address (e.g., 172.30.100.104) |
1730+ | `ip6` | `--ip6` | IPv6 address (e.g., 2001:db8::33) |
1731+ | `mac-address` | `--mac-address` | Container MAC address (e.g., 92:d0:c6:0a:29:33) |
1732+ | `link-local-ip` | `--link-local-ip` | Container IPv4/IPv6 link-local addresses |
1733+ | `driver-opt` | `docker network connect --driver-opt` | Network driver options |
1734+
1735+ ```console
1736+ $ docker network create --subnet 192.0.2.0/24 my-net1
1737+ $ docker network create --subnet 192.0.3.0/24 my-net2
1738+ $ docker run -itd --network=name=my-net1,ip=192.0.2.42 --network=name=my-net2,ip=192.0.3.42 busybox
1739+ ```
1740+
1741+ `sysctl` settings that start with `net.ipv4.`, `net.ipv6.` or `net.mpls.` can be
1742+ set per-interface using `driver-opt` label `com.docker.network.endpoint.sysctls`.
1743+ The interface name must be the string `IFNAME`.
1744+
1745+ To set more than one `sysctl` for an interface, quote the whole `driver-opt` field,
1746+ remembering to escape the quotes for the shell if necessary. For example, if the
1747+ interface to `my-net` is given name `eth0`, the following example sets sysctls
1748+ `net.ipv4.conf.eth0.log_martians=1` and `net.ipv4.conf.eth0.forwarding=0`, and
1749+ assigns the IPv4 address `192.0.2.42`.
1750+
1751+ ```console
1752+ $ docker network create --subnet 192.0.2.0/24 my-net
1753+ $ docker run -itd --network=name=my-net,\"driver-opt=com.docker.network.endpoint.sysctls=net.ipv4.conf.IFNAME.log_martians=1,net.ipv4.conf.IFNAME.forwarding=0\",ip=192.0.2.42 busybox
1754+ ```
17091755
17101756 > **Note**
17111757 >
1712- > The default bridge network only allow containers to communicate with each other using
1713- > internal IP addresses. User-created bridge networks provide DNS resolution between
1714- > containers using container names.
1715-
1716- You can disconnect a container from a network using the `docker network
1717- disconnect` command.
1758+ > Network drivers may restrict the sysctl settings that can be modified and, to protect
1759+ > the operation of the network, new restrictions may be added in the future.
17181760
1719- For more information on connecting a container to a network when using the `run` command, see the ["*Docker network overview*"](/network/).
1761+ For more information on connecting a container to a network when using the `run` command,
1762+ see the [Docker network overview](/network/).
17201763
17211764 ### Mount volumes from container (--volumes-from) {#volumes-from}
17221765
@@ -1795,7 +1838,7 @@ examples: |-
17951838
17961839 These `a`, `ctrl-a`, `X`, or `ctrl-\\` values are all examples of valid key
17971840 sequences. To configure a different configuration default key sequence for all
1798- containers, see [**Configuration file** section](/engine/ reference/commandline/ cli/#configuration-files).
1841+ containers, see [**Configuration file** section](/reference/cli/docker /#configuration-files).
17991842
18001843 ### Add host device to container (--device) {#device}
18011844
@@ -1870,17 +1913,19 @@ examples: |-
18701913
18711914 > **Note**
18721915 >
1873- > This is experimental feature and as such doesn't represent a stable API.
1916+ > The CDI feature is experimental, and potentially subject to change.
1917+ > CDI is currently only supported for Linux containers.
18741918
1875- Container Device Interface (CDI) is a
1876- [standardized ](https://github.com/cncf-tags/container-device-interface/blob/main/SPEC.md)
1877- mechanism for container runtimes to create containers which are able to
1878- interact with third party devices.
1919+ [ Container Device Interface
1920+ (CDI) ](https://github.com/cncf-tags/container-device-interface/blob/main/SPEC.md)
1921+ is a standardized mechanism for container runtimes to create containers which
1922+ are able to interact with third party devices.
18791923
1880- With CDI, device configurations are defined using a JSON file. In addition to
1881- enabling the container to interact with the device node, it also lets you
1882- specify additional configuration for the device, such as kernel modules, host
1883- libraries, and environment variables.
1924+ With CDI, device configurations are declaratively defined using a JSON or YAML
1925+ file. In addition to enabling the container to interact with the device node,
1926+ it also lets you specify additional configuration for the device, such as
1927+ environment variables, host mounts (such as shared objects), and executable
1928+ hooks.
18841929
18851930 You can reference a CDI device with the `--device` flag using the
18861931 fully-qualified name of the device, as shown in the following example:
@@ -1892,10 +1937,10 @@ examples: |-
18921937 This starts an `ubuntu` container with access to the specified CDI device,
18931938 `vendor.com/class=device-name`, assuming that:
18941939
1895- - A valid CDI specification (JSON file) for the requested device is available
1896- on the system running the daemon, in one of the configured CDI specification
1897- directories.
1898- - The CDI feature has been enabled on the daemon side, see [Enable CDI
1940+ - A valid CDI specification (JSON or YAML file) for the requested device is
1941+ available on the system running the daemon, in one of the configured CDI
1942+ specification directories.
1943+ - The CDI feature has been enabled in the daemon; see [Enable CDI
18991944 devices](/reference/cli/dockerd/#enable-cdi-devices).
19001945
19011946 ### Attach to STDIN/STDOUT/STDERR (-a, --attach) {#attach}
0 commit comments