From 4f9b076e8eecb19083b3875b7cacbc3b660fde75 Mon Sep 17 00:00:00 2001 From: yuexiao-wang Date: Wed, 28 Dec 2016 19:34:32 +0800 Subject: [PATCH] keep network option consistent between network connect and run Signed-off-by: yuexiao-wang --- cli/command/container/opts.go | 6 +++--- cli/command/network/connect.go | 4 ++-- contrib/completion/fish/docker.fish | 4 ++-- contrib/completion/zsh/_docker | 10 +++++----- docs/reference/commandline/create.md | 6 +++--- docs/reference/commandline/network_connect.md | 4 ++-- docs/reference/commandline/run.md | 6 +++--- man/docker-run.1.md | 6 +++--- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/cli/command/container/opts.go b/cli/command/container/opts.go index 0f41dd507c..c5fc152168 100644 --- a/cli/command/container/opts.go +++ b/cli/command/container/opts.go @@ -193,11 +193,11 @@ func addFlags(flags *pflag.FlagSet) *containerOptions { flags.MarkHidden("dns-opt") flags.Var(&copts.dnsSearch, "dns-search", "Set custom DNS search domains") flags.Var(&copts.expose, "expose", "Expose a port or a range of ports") - flags.StringVar(&copts.ipv4Address, "ip", "", "Container IPv4 address (e.g. 172.30.100.104)") - flags.StringVar(&copts.ipv6Address, "ip6", "", "Container IPv6 address (e.g. 2001:db8::33)") + flags.StringVar(&copts.ipv4Address, "ip", "", "IPv4 address (e.g., 172.30.100.104)") + flags.StringVar(&copts.ipv6Address, "ip6", "", "IPv6 address (e.g., 2001:db8::33)") flags.Var(&copts.links, "link", "Add link to another container") flags.Var(&copts.linkLocalIPs, "link-local-ip", "Container IPv4/IPv6 link-local addresses") - flags.StringVar(&copts.macAddress, "mac-address", "", "Container MAC address (e.g. 92:d0:c6:0a:29:33)") + flags.StringVar(&copts.macAddress, "mac-address", "", "Container MAC address (e.g., 92:d0:c6:0a:29:33)") flags.VarP(&copts.publish, "publish", "p", "Publish a container's port(s) to the host") flags.BoolVarP(&copts.publishAll, "publish-all", "P", false, "Publish all exposed ports to random ports") // We allow for both "--net" and "--network", although the latter is the recommended way. diff --git a/cli/command/network/connect.go b/cli/command/network/connect.go index 113c6c03f2..bc90ddaba7 100644 --- a/cli/command/network/connect.go +++ b/cli/command/network/connect.go @@ -37,8 +37,8 @@ func newConnectCommand(dockerCli *command.DockerCli) *cobra.Command { } flags := cmd.Flags() - flags.StringVar(&opts.ipaddress, "ip", "", "IP Address") - flags.StringVar(&opts.ipv6address, "ip6", "", "IPv6 Address") + flags.StringVar(&opts.ipaddress, "ip", "", "IPv4 address (e.g., 172.30.100.104)") + flags.StringVar(&opts.ipv6address, "ip6", "", "IPv6 address (e.g., 2001:db8::33)") flags.Var(&opts.links, "link", "Add link to another container") flags.StringSliceVar(&opts.aliases, "alias", []string{}, "Add network-scoped alias for the container") flags.StringSliceVar(&opts.linklocalips, "link-local-ip", []string{}, "Add a link-local address for the container") diff --git a/contrib/completion/fish/docker.fish b/contrib/completion/fish/docker.fish index 2715cb1aa6..8833e8caa8 100644 --- a/contrib/completion/fish/docker.fish +++ b/contrib/completion/fish/docker.fish @@ -135,7 +135,7 @@ complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s i -l interac complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l ipc -d 'Default is to create a private IPC namespace (POSIX SysV IPC) for the container' complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l link -d 'Add link to another container in the form of :alias' complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s m -l memory -d 'Memory limit (format: [], where unit = b, k, m or g)' -complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l mac-address -d 'Container MAC address (e.g. 92:d0:c6:0a:29:33)' +complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l mac-address -d 'Container MAC address (e.g., 92:d0:c6:0a:29:33)' complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l memory-swap -d "Total memory usage (memory + swap), set '-1' to disable swap (format: [], where unit = b, k, m or g)" complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l name -d 'Assign a name to the container' complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l net -d 'Set the Network mode for the container' @@ -326,7 +326,7 @@ complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s i -l interactiv complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l ipc -d 'Default is to create a private IPC namespace (POSIX SysV IPC) for the container' complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l link -d 'Add link to another container in the form of :alias' complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s m -l memory -d 'Memory limit (format: [], where unit = b, k, m or g)' -complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l mac-address -d 'Container MAC address (e.g. 92:d0:c6:0a:29:33)' +complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l mac-address -d 'Container MAC address (e.g., 92:d0:c6:0a:29:33)' complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l memory-swap -d "Total memory usage (memory + swap), set '-1' to disable swap (format: [], where unit = b, k, m or g)" complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l name -d 'Assign a name to the container' complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l net -d 'Set the Network mode for the container' diff --git a/contrib/completion/zsh/_docker b/contrib/completion/zsh/_docker index 8d00b13e6d..a5e5258f04 100644 --- a/contrib/completion/zsh/_docker +++ b/contrib/completion/zsh/_docker @@ -541,12 +541,12 @@ __docker_container_subcommand() { "($help)*--group=[Set one or more supplementary user groups for the container]:group:_groups" "($help -h --hostname)"{-h=,--hostname=}"[Container host name]:hostname:_hosts" "($help -i --interactive)"{-i,--interactive}"[Keep stdin open even if not attached]" - "($help)--ip=[Container IPv4 address]:IPv4: " - "($help)--ip6=[Container IPv6 address]:IPv6: " + "($help)--ip=[IPv4 address]:IPv4: " + "($help)--ip6=[IPv6 address]:IPv6: " "($help)--ipc=[IPC namespace to use]:IPC namespace: " "($help)--isolation=[Container isolation technology]:isolation:(default hyperv process)" "($help)*--link=[Add link to another container]:link:->link" - "($help)*--link-local-ip=[Add a link-local address for the container]:IPv4/IPv6: " + "($help)*--link-local-ip=[Container IPv4/IPv6 link-local addresses]:IPv4/IPv6: " "($help)*"{-l=,--label=}"[Container metadata]:label: " "($help)--log-driver=[Default driver for container logs]:logging driver:__docker_complete_log_drivers" "($help)*--log-opt=[Log driver specific options]:log driver options:__docker_complete_log_options" @@ -1142,8 +1142,8 @@ __docker_network_subcommand() { _arguments $(__docker_arguments) \ $opts_help \ "($help)*--alias=[Add network-scoped alias for the container]:alias: " \ - "($help)--ip=[Container IPv4 address]:IPv4: " \ - "($help)--ip6=[Container IPv6 address]:IPv6: " \ + "($help)--ip=[IPv4 address]:IPv4: " \ + "($help)--ip6=[IPv6 address]:IPv6: " \ "($help)*--link=[Add a link to another container]:link:->link" \ "($help)*--link-local-ip=[Add a link-local address for the container]:IPv4/IPv6: " \ "($help -)1:network:__docker_complete_networks" \ diff --git a/docs/reference/commandline/create.md b/docs/reference/commandline/create.md index 0218af3a76..439e75fac9 100644 --- a/docs/reference/commandline/create.md +++ b/docs/reference/commandline/create.md @@ -66,8 +66,8 @@ Options: -i, --interactive Keep STDIN open even if not attached --io-maxbandwidth string Maximum IO bandwidth limit for the system drive (Windows only) --io-maxiops uint Maximum IOps limit for the system drive (Windows only) - --ip string Container IPv4 address (e.g. 172.30.100.104) - --ip6 string Container IPv6 address (e.g. 2001:db8::33) + --ip string IPv4 address (e.g., 172.30.100.104) + --ip6 string IPv6 address (e.g., 2001:db8::33) --ipc string IPC namespace to use --isolation string Container isolation technology --kernel-memory string Kernel memory limit @@ -77,7 +77,7 @@ Options: --link-local-ip value Container IPv4/IPv6 link-local addresses (default []) --log-driver string Logging driver for the container --log-opt value Log driver options (default []) - --mac-address string Container MAC address (e.g. 92:d0:c6:0a:29:33) + --mac-address string Container MAC address (e.g., 92:d0:c6:0a:29:33) -m, --memory string Memory limit --memory-reservation string Memory soft limit --memory-swap string Swap limit equal to memory plus swap: '-1' to enable unlimited swap diff --git a/docs/reference/commandline/network_connect.md b/docs/reference/commandline/network_connect.md index 52459a5d5f..1c8548a4f9 100644 --- a/docs/reference/commandline/network_connect.md +++ b/docs/reference/commandline/network_connect.md @@ -23,8 +23,8 @@ Connect a container to a network Options: --alias value Add network-scoped alias for the container (default []) --help Print usage - --ip string IP Address - --ip6 string IPv6 Address + --ip string IPv4 address (e.g., 172.30.100.104) + --ip6 string IPv6 address (e.g., 2001:db8::33) --link value Add link to another container (default []) --link-local-ip value Add a link-local address for the container (default []) ``` diff --git a/docs/reference/commandline/run.md b/docs/reference/commandline/run.md index 6195647012..56f67a26a6 100644 --- a/docs/reference/commandline/run.md +++ b/docs/reference/commandline/run.md @@ -76,8 +76,8 @@ Options: the system uses bytes per second. --io-maxbandwidth and --io-maxiops are mutually exclusive options. --io-maxiops uint Maximum IOps limit for the system drive (Windows only) - --ip string Container IPv4 address (e.g. 172.30.100.104) - --ip6 string Container IPv6 address (e.g. 2001:db8::33) + --ip string IPv4 address (e.g., 172.30.100.104) + --ip6 string IPv6 address (e.g., 2001:db8::33) --ipc string IPC namespace to use --isolation string Container isolation technology --kernel-memory string Kernel memory limit @@ -87,7 +87,7 @@ Options: --link-local-ip value Container IPv4/IPv6 link-local addresses (default []) --log-driver string Logging driver for the container --log-opt value Log driver options (default []) - --mac-address string Container MAC address (e.g. 92:d0:c6:0a:29:33) + --mac-address string Container MAC address (e.g., 92:d0:c6:0a:29:33) -m, --memory string Memory limit --memory-reservation string Memory soft limit --memory-swap string Swap limit equal to memory plus swap: '-1' to enable unlimited swap diff --git a/man/docker-run.1.md b/man/docker-run.1.md index be3df0be35..fe671e54aa 100644 --- a/man/docker-run.1.md +++ b/man/docker-run.1.md @@ -317,12 +317,12 @@ redirection on the host system. When set to true, keep stdin open even if not attached. The default is false. **--ip**="" - Sets the container's interface IPv4 address (e.g. 172.23.0.9) + Sets the container's interface IPv4 address (e.g., 172.23.0.9) It can only be used in conjunction with **--network** for user-defined networks **--ip6**="" - Sets the container's interface IPv6 address (e.g. 2001:db8::1b99) + Sets the container's interface IPv6 address (e.g., 2001:db8::1b99) It can only be used in conjunction with **--network** for user-defined networks @@ -401,7 +401,7 @@ the value of --memory. unit, `b` is used. Set LIMIT to `-1` to enable unlimited swap. **--mac-address**="" - Container MAC address (e.g. 92:d0:c6:0a:29:33) + Container MAC address (e.g., 92:d0:c6:0a:29:33) Remember that the MAC address in an Ethernet network must be unique. The IPv6 link-local address will be based on the device's MAC address