1
0
mirror of https://github.com/docker/cli.git synced 2026-01-15 07:40:57 +03:00

Merge component 'cli' from git@github.com:docker/cli master

This commit is contained in:
GordonTheTurtle
2018-02-02 16:41:17 +00:00
2 changed files with 57 additions and 63 deletions

View File

@@ -3354,7 +3354,6 @@ _docker_service_update_and_create() {
local options_with_args="
--endpoint-mode
--entrypoint
--env -e
--force
--health-cmd
--health-interval
@@ -3363,12 +3362,10 @@ _docker_service_update_and_create() {
--health-timeout
--hostname
--isolation
--label -l
--limit-cpu
--limit-memory
--log-driver
--log-opt
--mount
--replicas
--reserve-cpu
--reserve-memory
@@ -3416,11 +3413,14 @@ _docker_service_update_and_create() {
--dns
--dns-option
--dns-search
--env -e
--env-file
--generic-resource
--group
--host
--label -l
--mode
--mount
--name
--network
--placement-pref
@@ -3429,39 +3429,14 @@ _docker_service_update_and_create() {
"
case "$prev" in
--config)
__docker_complete_configs
return
;;
--env-file)
_filedir
return
;;
--group)
COMPREPLY=( $(compgen -g -- "$cur") )
return
;;
--host)
case "$cur" in
*:)
__docker_complete_resolved_hostname
return
;;
esac
;;
--mode)
COMPREPLY=( $( compgen -W "global replicated" -- "$cur" ) )
return
;;
--placement-pref)
COMPREPLY=( $( compgen -W "spread" -S = -- "$cur" ) )
__docker_nospace
return
;;
--secret)
__docker_complete_secrets
return
;;
esac
fi
if [ "$subcommand" = "update" ] ; then
@@ -3479,6 +3454,8 @@ _docker_service_update_and_create() {
--dns-rm
--dns-search-add
--dns-search-rm
--env-add
--env-rm
--generic-resource-add
--generic-resource-rm
--group-add
@@ -3486,6 +3463,10 @@ _docker_service_update_and_create() {
--host-add
--host-rm
--image
--label-add
--label-rm
--mount-add
--mount-rm
--network-add
--network-rm
--placement-pref-add
@@ -3498,39 +3479,14 @@ _docker_service_update_and_create() {
"
case "$prev" in
--config-add|--config-rm)
__docker_complete_configs
--env-rm)
COMPREPLY=( $( compgen -e -- "$cur" ) )
return
;;
--group-add|--group-rm)
COMPREPLY=( $(compgen -g -- "$cur") )
return
;;
--host-add|--host-rm)
case "$cur" in
*:)
__docker_complete_resolved_hostname
return
;;
esac
;;
--image)
__docker_complete_images --repo --tag --id
return
;;
--network-add|--network-rm)
__docker_complete_networks
return
;;
--placement-pref-add|--placement-pref-rm)
COMPREPLY=( $( compgen -W "spread" -S = -- "$cur" ) )
__docker_nospace
return
;;
--secret-add|--secret-rm)
__docker_complete_secrets
return
;;
esac
fi
@@ -3544,16 +3500,32 @@ _docker_service_update_and_create() {
esac
case "$prev" in
--config|--config-add|--config-rm)
__docker_complete_configs
return
;;
--endpoint-mode)
COMPREPLY=( $( compgen -W "dnsrr vip" -- "$cur" ) )
return
;;
--env|-e)
--env|-e|--env-add)
# we do not append a "=" here because "-e VARNAME" is legal systax, too
COMPREPLY=( $( compgen -e -- "$cur" ) )
__docker_nospace
return
;;
--group|--group-add|--group-rm)
COMPREPLY=( $(compgen -g -- "$cur") )
return
;;
--host|--host-add|--host-rm)
case "$cur" in
*:)
__docker_complete_resolved_hostname
return
;;
esac
;;
--isolation)
__docker_complete_isolation
return
@@ -3566,10 +3538,15 @@ _docker_service_update_and_create() {
__docker_complete_log_options
return
;;
--network)
--network|--network-add|--network-rm)
__docker_complete_networks
return
;;
--placement-pref|--placement-pref-add|--placement-pref-rm)
COMPREPLY=( $( compgen -W "spread" -S = -- "$cur" ) )
__docker_nospace
return
;;
--restart-condition)
COMPREPLY=( $( compgen -W "any none on-failure" -- "$cur" ) )
return
@@ -3578,6 +3555,10 @@ _docker_service_update_and_create() {
COMPREPLY=( $( compgen -W "continue pause" -- "$cur" ) )
return
;;
--secret|--secret-add|--secret-rm)
__docker_complete_secrets
return
;;
--stop-signal)
__docker_complete_signals
return

View File

@@ -92,6 +92,18 @@ Network names must be unique. The Docker daemon attempts to identify naming
conflicts but this is not guaranteed. It is the user's responsibility to avoid
name conflicts.
### Overlay network limitations
You should create overlay networks with `/24` blocks (the default), which limits
you to 256 IP addresses, when you create networks using the default VIP-based
endpoint-mode. This recommendation addresses
[limitations with swarm mode](https://github.com/moby/moby/issues/30820). If you
need more than 256 IP addresses, do not increase the IP block size. You can
either use `dnsrr` endpoint mode with an external load balancer, or use multiple
smaller overlay networks. See
[Configure service discovery](https://docs.docker.com/engine/swarm/networking/#configure-service-discovery)
for more information about different endpoint modes.
## Examples
### Connect containers
@@ -141,15 +153,16 @@ $ docker network create \
If you omit the `--gateway` flag the Engine selects one for you from inside a
preferred pool. For `overlay` networks and for network driver plugins that
support it you can create multiple subnetworks.
support it you can create multiple subnetworks. This example uses two `/25`
subnet mask to adhere to the current guidance of not having more than 256 IPs in
a single overlay network. Each of the subnetworks has 126 usable addresses.
```bash
$ docker network create -d overlay \
--subnet=192.168.0.0/16 \
--subnet=192.170.0.0/16 \
--gateway=192.168.0.100 \
--gateway=192.170.0.100 \
--ip-range=192.168.1.0/24 \
--subnet=192.168.1.0/25 \
--subnet=192.170.2.0/25 \
--gateway=192.168.1.100 \
--gateway=192.170.2.100 \
--aux-address="my-router=192.168.1.5" --aux-address="my-switch=192.168.1.6" \
--aux-address="my-printer=192.170.1.5" --aux-address="my-nas=192.170.1.6" \
my-multihost-network