From 253a5f4ea2aa5c14530cd01530004029b71fc28e Mon Sep 17 00:00:00 2001 From: "Arnaud Porterie (icecrime)" Date: Mon, 6 Jun 2016 16:33:00 -0700 Subject: [PATCH] Rename `--net` to `--network` Add a `--network` flag which replaces `--net` without deprecating it yet. The `--net` flag remains hidden and supported. Add a `--network-alias` flag which replaces `--net-alias` without deprecating it yet. The `--net-alias` flag remains hidden and supported. Signed-off-by: Arnaud Porterie (icecrime) --- docs/extend/plugins_network.md | 2 +- docs/reference/commandline/create.md | 4 ++-- docs/reference/commandline/dockerd.md | 2 +- docs/reference/commandline/network_connect.md | 4 ++-- docs/reference/commandline/network_create.md | 4 ++-- docs/reference/commandline/run.md | 14 +++++++------- docs/reference/run.md | 16 ++++++++-------- man/docker-create.1.md | 6 +++--- man/docker-run.1.md | 6 +++--- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/docs/extend/plugins_network.md b/docs/extend/plugins_network.md index 9199f784ce..ec1ccddfea 100644 --- a/docs/extend/plugins_network.md +++ b/docs/extend/plugins_network.md @@ -46,7 +46,7 @@ Some network driver plugins are listed in [plugins](plugins.md) The `mynet` network is now owned by `weave`, so subsequent commands referring to that network will be sent to the plugin, - $ docker run --net=mynet busybox top + $ docker run --network=mynet busybox top ## Write a network plugin diff --git a/docs/reference/commandline/create.md b/docs/reference/commandline/create.md index 49f0c96c3b..1d41c68665 100644 --- a/docs/reference/commandline/create.md +++ b/docs/reference/commandline/create.md @@ -72,13 +72,13 @@ Options: --memory-swap string Swap limit equal to memory plus swap: '-1' to enable unlimited swap --memory-swappiness int Tune container memory swappiness (0 to 100) (default -1) --name string Assign a name to the container - --net string Connect a container to a network (default "default") + --network-alias value Add network-scoped alias for the container (default []) + --network string Connect a container to a network (default "default") 'bridge': create a network stack on the default Docker bridge 'none': no networking 'container:': reuse another container's network stack 'host': use the Docker host network stack '|': connect to a user-defined network - --net-alias value Add network-scoped alias for the container (default []) --no-healthcheck Disable any container-specified HEALTHCHECK --oom-kill-disable Disable OOM Killer --oom-score-adj int Tune host's OOM preferences (-1000 to 1000) diff --git a/docs/reference/commandline/dockerd.md b/docs/reference/commandline/dockerd.md index 8c53fd02c3..02acdc9468 100644 --- a/docs/reference/commandline/dockerd.md +++ b/docs/reference/commandline/dockerd.md @@ -921,7 +921,7 @@ This option will completely disable user namespace mapping for the container's u The following standard Docker features are currently incompatible when running a Docker daemon with user namespaces enabled: - - sharing PID or NET namespaces with the host (`--pid=host` or `--net=host`) + - sharing PID or NET namespaces with the host (`--pid=host` or `--network=host`) - A `--read-only` container filesystem (this is a Linux kernel restriction against remounting with modified flags of a currently mounted filesystem when inside a user namespace) - external (volume or graph) drivers which are unaware/incapable of using daemon user mappings - Using `--privileged` mode flag on `docker run` (unless also specifying `--userns=host`) diff --git a/docs/reference/commandline/network_connect.md b/docs/reference/commandline/network_connect.md index f60abe574a..60accc763c 100644 --- a/docs/reference/commandline/network_connect.md +++ b/docs/reference/commandline/network_connect.md @@ -32,10 +32,10 @@ the same network. $ docker network connect multi-host-network container1 ``` -You can also use the `docker run --net=` option to start a container and immediately connect it to a network. +You can also use the `docker run --network=` option to start a container and immediately connect it to a network. ```bash -$ docker run -itd --net=multi-host-network busybox +$ docker run -itd --network=multi-host-network busybox ``` You can specify the IP address you want to be assigned to the container's interface. diff --git a/docs/reference/commandline/network_create.md b/docs/reference/commandline/network_create.md index 5737496745..bb08c07652 100644 --- a/docs/reference/commandline/network_create.md +++ b/docs/reference/commandline/network_create.md @@ -82,11 +82,11 @@ name conflicts. ## Connect containers -When you start a container, use the `--net` flag to connect it to a network. +When you start a container, use the `--network` flag to connect it to a network. This example adds the `busybox` container to the `mynet` network: ```bash -$ docker run -itd --net=mynet busybox +$ docker run -itd --network=mynet busybox ``` If you want to add a container to a network after the container is already diff --git a/docs/reference/commandline/run.md b/docs/reference/commandline/run.md index d454a6183a..841b63572e 100644 --- a/docs/reference/commandline/run.md +++ b/docs/reference/commandline/run.md @@ -78,13 +78,13 @@ Options: --memory-swap string Swap limit equal to memory plus swap: '-1' to enable unlimited swap --memory-swappiness int Tune container memory swappiness (0 to 100) (default -1). --name string Assign a name to the container - --net string Connect a container to a network (default "default") + --network-alias value Add network-scoped alias for the container (default []) + --network string Connect a container to a network 'bridge': create a network stack on the default Docker bridge 'none': no networking 'container:': reuse another container's network stack 'host': use the Docker host network stack '|': connect to a user-defined network - --net-alias value Add network-scoped alias for the container (default []) --no-healthcheck Disable any container-specified HEALTHCHECK --oom-kill-disable Disable OOM Killer --oom-score-adj int Tune host's OOM preferences (-1000 to 1000) @@ -360,20 +360,20 @@ For additional information on working with labels, see [*Labels - custom metadata in Docker*](../../userguide/labels-custom-metadata.md) in the Docker User Guide. -### Connect a container to a network (--net) +### Connect a container to a network (--network) -When you start a container use the `--net` flag to connect it to a network. +When you start a container use the `--network` flag to connect it to a network. This adds the `busybox` container to the `my-net` network. ```bash -$ docker run -itd --net=my-net busybox +$ docker run -itd --network=my-net busybox ``` You can also choose the IP addresses for the container with `--ip` and `--ip6` flags when you start the container on a user-defined network. ```bash -$ docker run -itd --net=my-net --ip=10.10.9.75 busybox +$ docker run -itd --network=my-net --ip=10.10.9.75 busybox ``` If you want to add a running container to a network use the `docker network connect` subcommand. @@ -673,4 +673,4 @@ network namespace, run this command: `Network Namespace`: Sysctls beginning with net.* - If you use the `--net=host` option using these sysctls will not be allowed. + If you use the `--network=host` option using these sysctls will not be allowed. diff --git a/docs/reference/run.md b/docs/reference/run.md index db0e86b6e9..ab5ed29f84 100644 --- a/docs/reference/run.md +++ b/docs/reference/run.md @@ -259,7 +259,7 @@ $ strace -p 1 The UTS namespace is for setting the hostname and the domain that is visible to running processes in that namespace. By default, all containers, including -those with `--net=host`, have their own UTS namespace. The `host` setting will +those with `--network=host`, have their own UTS namespace. The `host` setting will result in the container using the same UTS namespace as the host. Note that `--hostname` is invalid in `host` UTS mode. @@ -289,13 +289,13 @@ of the containers. ## Network settings --dns=[] : Set custom dns servers for the container - --net="bridge" : Connect a container to a network + --network="bridge" : Connect a container to a network 'bridge': create a network stack on the default Docker bridge 'none': no networking 'container:': reuse another container's network stack 'host': use the Docker host network stack '|': connect to a user-defined network - --net-alias=[] : Add network-scoped alias for the container + --network-alias=[] : Add network-scoped alias for the container --add-host="" : Add a line to /etc/hosts (host:IP) --mac-address="" : Sets the container's Ethernet device's MAC address --ip="" : Sets the container's Ethernet device's IPv4 address @@ -304,7 +304,7 @@ of the containers. By default, all containers have networking enabled and they can make any outgoing connections. The operator can completely disable networking -with `docker run --net none` which disables all incoming and outgoing +with `docker run --network none` which disables all incoming and outgoing networking. In cases like this, you would perform I/O through files or `STDIN` and `STDOUT` only. @@ -404,14 +404,14 @@ docker daemon. It is recommended to run containers in this mode when their networking performance is critical, for example, a production Load Balancer or a High Performance Web Server. -> **Note**: `--net="host"` gives the container full access to local system +> **Note**: `--network="host"` gives the container full access to local system > services such as D-bus and is therefore considered insecure. #### Network: container With the network set to `container` a container will share the network stack of another container. The other container's name must be -provided in the format of `--net container:`. Note that `--add-host` +provided in the format of `--network container:`. Note that `--add-host` `--hostname` `--dns` `--dns-search` `--dns-opt` and `--mac-address` are invalid in `container` netmode, and `--publish` `--publish-all` `--expose` are also invalid in `container` netmode. @@ -422,7 +422,7 @@ running the `redis-cli` command and connecting to the Redis server over the $ docker run -d --name redis example/redis --bind 127.0.0.1 $ # use the redis container's network stack to access localhost - $ docker run --rm -it --net container:redis example/redis-cli -h 127.0.0.1 + $ docker run --rm -it --network container:redis example/redis-cli -h 127.0.0.1 #### User-defined network @@ -440,7 +440,7 @@ driver and running a container in the created network ``` $ docker network create -d bridge my-net -$ docker run --net=my-net -itd --name=container3 busybox +$ docker run --network=my-net -itd --name=container3 busybox ``` ### Managing /etc/hosts diff --git a/man/docker-create.1.md b/man/docker-create.1.md index be0e5e9d29..e9b1ebe31a 100644 --- a/man/docker-create.1.md +++ b/man/docker-create.1.md @@ -52,8 +52,8 @@ docker-create - Create a new container [**--memory-swap**[=*LIMIT*]] [**--memory-swappiness**[=*MEMORY-SWAPPINESS*]] [**--name**[=*NAME*]] -[**--net**[=*"bridge"*]] -[**--net-alias**[=*[]*]] +[**--network-alias**[=*[]*]] +[**--network**[=*"bridge"*]] [**--oom-kill-disable**] [**--oom-score-adj**[=*0*]] [**-P**|**--publish-all**] @@ -276,7 +276,7 @@ unit, `b` is used. Set LIMIT to `-1` to enable unlimited swap. 'host': use the Docker host network stack. Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure. '|': connect to a user-defined network -**--net-alias**=[] +**--network-alias**=[] Add network-scoped alias for the container **--oom-kill-disable**=*true*|*false* diff --git a/man/docker-run.1.md b/man/docker-run.1.md index 6fdc93cd60..d4a2953161 100644 --- a/man/docker-run.1.md +++ b/man/docker-run.1.md @@ -54,8 +54,8 @@ docker-run - Run a command in a new container [**--memory-swap**[=*LIMIT*]] [**--memory-swappiness**[=*MEMORY-SWAPPINESS*]] [**--name**[=*NAME*]] -[**--net**[=*"bridge"*]] -[**--net-alias**[=*[]*]] +[**--network-alias**[=*[]*]] +[**--network**[=*"bridge"*]] [**--oom-kill-disable**] [**--oom-score-adj**[=*0*]] [**-P**|**--publish-all**] @@ -395,7 +395,7 @@ and foreground Docker containers. 'host': use the Docker host network stack. Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure. '|': connect to a user-defined network -**--net-alias**=[] +**--network-alias**=[] Add network-scoped alias for the container **--oom-kill-disable**=*true*|*false*