Commit Graph

2090 Commits

Author SHA1 Message Date
Tibor Vass 45c8a3ddd5 Prevent panic on update --container-label-add
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit e462b4507a7020ae96ec4f4806877bff3a0cae99)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 03:51:43 -07:00
Vincent Demeester 8fe03baa41 Add container labels to service create/update
Swarm mode makes it possible through the API to set labels to containers
but not through command line. This tries to fix it.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 4031d70d1be2f02e1c9d6f7738f2a816be7eeef2)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-26 03:51:43 -07:00
Brian Goff 07735b4f0c fix panic on --label-add
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 85bc3194aa12c19a5bd755666d1e9617dc1bb322)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:24:47 -07:00
Aaron Lehmann a3639e6ac6 Add failure action for rolling updates
This changes the default behavior so that rolling updates will not
proceed once an updated task fails to start, or stops running during the
update. Users can use docker service inspect --pretty servicename to see
the update status, and if it pauses due to a failure, it will explain
that the update is paused, and show the task ID that caused it to pause.
It also shows the time since the update started.

A new --update-on-failure=(pause|continue) flag selects the
behavior. Pause means the update stops once a task fails, continue means
the old behavior of continuing the update anyway.

In the future this will be extended with additional behaviors like
automatic rollback, and flags controlling parameters like how many tasks
need to fail for the update to stop proceeding. This is a minimal
solution for 1.12.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 57ae29aa74e77ade3c91b1c77ba766512dae9ab4)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:24:43 -07:00
Andrea Luzzardi 42e97d23e2 service tasks: Improve error reporting
- Tasks will display all tasks (`-a` is the default and was removed)
- Nest tasks to help display history
- Display task errors inline

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
(cherry picked from commit edd67fd4ad961f0782f1f94e6a26c95810dd037e)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:29 -07:00
Sebastiaan van Stijn ec241bfeaf make network errors less DRY
There's existing code to generate these
kind of errors, so make the errors added
in commit cc493a52a46271df82dbebea26038502b85788b9
less DRY.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3fa9d77bf312652ae04e902a2b6e73a0b91ec007)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:28 -07:00
Sebastiaan van Stijn e9190e0764 Add new error to API docs
Commit cc493a52a46271df82dbebea26038502b85788b9 added
a constraint to network connect/disconnect operations
on "Swarm scoped" networks.

This adds those errors to the API documentation. Also
changes the error to lowercase for consistency.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b0089e48272f18d856ba147b393371c18d5683fb)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:23 -07:00
Tianyi Wang 14038215d3 Fix high cpu usage caused by docker stats.
Signed-off-by: Tianyi Wang <capkurmagati@gmail.com>
(cherry picked from commit 54e8beec9b33fcca4263516b6f03ef96c29132a3)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:16 -07:00
Madhu Venugopal 71d54a4bd3 Prevent network connect/disconnect on swarm scoped networks
Swarm handles service updates quite differently and also it doesnt
support worker driver network operations. Hence prevent containers from
connecting to swarm scoped networks

Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 8f9066c468d7312af722c7cf9fc27b7c8ab79fc3)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:15 -07:00
allencloud 4cd455a8d9 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 4e959ef2f7f063803d04e06166f459257eb94b5c)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:15 -07:00
Aaron Lehmann a0d1201e02 Require listen address and advertise address to be an IP address or an interface name
Hostnames are not supported for now because libnetwork can't use them
for overlay networking yet.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit fca0b18dcba99a7fbb8b430a55dc7bf60d5c1356)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:12 -07:00
Aaron Lehmann 762a73bf7f Split advertised address from listen address
There are currently problems with "swarm init" and "swarm join" when an
explicit --listen-addr flag is not provided. swarmkit defaults to
finding the IP address associated with the default route, and in cloud
setups this is often the wrong choice.

Introduce a notion of "advertised address", with the client flag
--advertise-addr, and the daemon flag --swarm-default-advertise-addr to
provide a default. The default listening address is now 0.0.0.0, but a
valid advertised address must be detected or specified.

If no explicit advertised address is specified, error out if there is
more than one usable candidate IP address on the system. This requires a
user to explicitly choose instead of letting swarmkit make the wrong
choice. For the purposes of this autodetection, we ignore certain
interfaces that are unlikely to be relevant (currently docker*).

The user is also required to choose a listen address on swarm init if
they specify an explicit advertise address that is a hostname or an IP
address that's not local to the system. This is a requirement for
overlay networking.

Also support specifying interface names to --listen-addr,
--advertise-addr, and the daemon flag --swarm-default-advertise-addr.
This will fail if the interface has multiple IP addresses (unless it has
a single IPv4 address and a single IPv6 address - then we resolve the
tie in favor of IPv4).

This change also exposes the node's externally-reachable address in
docker info, as requested by #24017.

Make corresponding API and CLI docs changes.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit a0ccd0d42fdb0dd2005f67604cb81a5a6b26787e)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:18:03 -07:00
Andrea Luzzardi e6464aa5ab CLI: Change default Swarm task history retention limit.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
(cherry picked from commit d97c0a1f253fe61957047ea4b21d9e764dc7d783)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:34 -07:00
Sebastiaan van Stijn b7a38b19b3 Change "rotate_worker_token" to "rotateWorkerToken"
This renames the `rotate_xxx` flags to camelBack, for
consistency with other API query-params, such as
`detachKeys`, `noOverwriteDirNonDir`, and `fromImage`.

Also makes this flag accept a wider range of boolean
values ("0", "1", "true", "false"), and throw an error
if an invalid value is passed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit bd81df12780b0765e55582574eaa2a125adf65fa)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:26 -07:00
Stephen J Day 986a968044 api/client/service: mount option defaults and aliases
Simplifies the mount option usage by providing common aliases for
`source` and `target`. The default mount type is now volume.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 634f54a047bfcd2ac95bdcdfe04da7eabe02cbec)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:08 -07:00
Stephen J Day 16744cb970 api/client/service: default update parallelism to 1
When updates happen, the current behavior is to kill all running
instances and dispatch new tasks. Common use cases for container updates
involve small numbers of containers, meaning the app will go down on
most updates. Setting parallelism to 1 ensures that at most one task
will go down during the update. Services with higher replica counts can
increase this number accordingly to meet their needs.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 67246afd3dbcb53fea470bd3e45578370207139d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:08 -07:00
Vincent Demeester 9ec67fd8d1 Append --registry-auth with with
`--with-registry-auth` is more explicit.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 8426f72107f351b769babadeabbf13f205126514)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:01 -07:00
Aaron Lehmann 7836221015 Reorder swarm commands
This way "join-token" appears next to "join" in the help output.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 58ba4c313b1f19dfb1d50cb32238045d7b3db91d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:17:01 -07:00
Aaron Lehmann 5d7a3f7b5f Replace secrets with join tokens
Implement the proposal from
https://github.com/docker/docker/issues/24430#issuecomment-233100121

Removes acceptance policy and secret in favor of an automatically
generated join token that combines the secret, CA hash, and
manager/worker role into a single opaque string.

Adds a docker swarm join-token subcommand to inspect and rotate the
tokens.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 2cc5bd33eef038bf5721582e2410ba459bb656e9)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:59 -07:00
Sebastiaan van Stijn 4d7d354cff Change mount-types to lowercase
these values were changed to lowercase in
690cb2d08c,
but not changed accordingly in docker/docker.

this changes the mounttypes to lowercase

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8f93128cd619e1d11be1bc0ae21f1362b1e3f9ad)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:28 -07:00
Nishant Totla 5d56800537 Send registry auth token for service deploy
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
(cherry picked from commit a26bdd8607c62e6e736d06e9ec8f0908c4808d74)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:16 -07:00
Stephen J Day 6a06d8d94c api/client/service: shorten to volume-opt
`volume-driver-opt` was too verbose for its own existence and the sanity
of those in the vicinity. The much better, sleeker `volume-opt` replaces
it. 7 bytes and a case of carpal tunnel syndrome are saved!

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit a40b5820c91640183b40e0668f6802415e6adc14)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:16 -07:00
Sebastiaan van Stijn 33ff331ad7 Rename --bundle to --file
This renames the '--bundle' flag for docker (stack) deploy
to be consistent with 'docker build'.

Note that there's no shorthand '-f' added for now,
because this may be confusing on 'docker stack config',
which also takes a file, and for which we may want to
have a '--format' flag in future.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 06f35262c47629fef78e36daaa2742c2c0d7c3a9)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:44 -07:00
Yi EungJun a3d9a99c0e Fix the usage for `service rm` command
Signed-off-by: Yi EungJun <eungjun.yi@navercorp.com>
(cherry picked from commit cf61cd3a920809f6a0be44a584f365544acaf1a9)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:44 -07:00
Vincent Demeester 1b131678da Add documentation for stack commands
Also removes the `-f` flags of bundle to follow the single-letter flags
evaluation.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 10919e890942cbdaa65f180dbcd475d21b9c6713)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:43 -07:00
Daniel Nephin 0649299908 Dont run man generation as part of test-unit.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 47cca88c8c151ebf3dd25adcf28ac1b2f75c76fb)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:42 -07:00
Daniel Nephin 3430f2e756 Set Long text for volume commands so they can be used to generate man pages.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 25e9b06ac0750396f35d3f52f71c44b1072f0972)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:42 -07:00
Sebastiaan van Stijn 45920009cc Don't automagically add "[OPTIONS]" to usage
This removes the logic to automatically
add [OPTIONS] to the usage output.

The current logic was broken if a command
only has deprecated or hidden flags, and
in many cases put the [OPTIONS] in the
wrong location.

Requiring the usage string to be set
manually gives more predictable results,
and shouldn't require much to maintain.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 4f0b5105524649169d765bb94c2806209ab21904)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:41 -07:00
Dong Chen f3fea0ea88 Support node label update.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
(cherry picked from commit e1165cdfd1d666b1d4e041ef6a0d5fd049e041c1)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:26 -07:00
Stephen J Day 71a8ee2f49 swarm: add log driver support for services
Adds log driver support for service creation and update. Add flags
`--log-driver` and `--log-opt` to match `docker run`. Log drivers are
configured per service.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit e778ba2d5b1e5074fe413dffaa365f3d37b175c7)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:25 -07:00
John Starks 4d0f6041ad Windows: Always enable VT emulation
Always enable VT output emulation when starting the process so that
non-attaching commands can still output VT codes.

Also remove the version block for using the native console and just rely
on supported flags being present.

Signed-off-by: John Starks <jostarks@microsoft.com>
(cherry picked from commit 4acc2c7499425b9c2521977019d9fe4da73e6af8)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:25 -07:00
Anusha Ragunathan da773af885 Print plugin name on successful install, enable and disable.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 6dca1e6d3f875de7a6652390f65fdb8ec2623e3b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:25 -07:00
allencloud 5fcac2cdfd better command `docker network create -h` output
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit d0081a0f476f91b0dc6b28c480e7c95c06b05ebb)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:24 -07:00
Daniel Nephin cf2b19a72e Only show port name if set.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 909c596fa5956ed02b4708a437a828a2829c9bd5)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:13 -07:00
Daniel Nephin fc3d339109 Fix multi-remove during service update.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 3249c1d0e79f57642b96f6692ffa44f46f15b602)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:59 -07:00
Daniel Nephin fad55b0ea1 Change the add/update flags to include 'add'
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 4c6faa434071b87a55256e86020cb78495e9951d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:59 -07:00
Daniel Nephin 1cf4bd4df7 PR feedback
improve help text for service update remove flags
implement proper merge update of placement flag
more code re-use in update functions using a toRemove set.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit ead1f62abae5e5ad188536a01fb88d55339e3f63)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:59 -07:00
Daniel Nephin b5f1b77a23 Add remove flags for service update
with unit tests

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit dc33fc1ff433fcc70efc22f5cea9b87c6ec64a3b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:59 -07:00
Aaron Lehmann 32b12ed57a Use spaces, not tabs, to format sample "swarm join" command
Using tabs here seems to cause copy/paste problems in some terminals.
Using spaces is safer.

Fixes #24609

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 6de8fcb2f2baf335fc24e10909078199af528e8d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:59 -07:00
Dong Chen a769e22b70 Fix service inspect --pretty.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
(cherry picked from commit 08ae4e544d5744e975da0f89c4f04baa2b8474f2)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:58 -07:00
Sebastiaan van Stijn a89bd71433 Remove dead code for "inspect --pretty"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 4d87f9083bfb3147566997b3f48c4805229f7c94)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:58 -07:00
Daniel Nephin 9f86a9712d Merge service command and args as a string.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 674d227445887ea2f9a0fde6ebb7838bcce58578)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:58 -07:00
Sebastiaan van Stijn 7491ebe00a Remove shorthand flags for "mount", "pretty", and "no-resolve"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7bf0faf42377a91a8535b443201d9ad62326889b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:58 -07:00
Vincent Demeester cda05164ba Remove --command flag for service update
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit e4a024d5902df1d3db8b9fff8865304afa2305e6)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:57 -07:00
Sebastiaan van Stijn ca9805f78d Make labels human readable
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ea365e4cb37d037046364773d01a744b1258ce4e)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:55 -07:00
Akihiro Suda eb8bbea3d1 Remove "Yes"/"No" and use "true"/"false" consistently in `docker info`
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit c6b7bd1aa6b94ab242d6310419f1c3a7964ffa02)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:21 -07:00
johnharris85 c0a787db2b Add support for comma-separated --auto-accept syntax.
Signed-off-by: John Harris <john@johnharris.io>

(cherry picked from commit 8e148827734a94165156adfd0f6d202d28dff142)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:36 -07:00
Qiang Huang 88d82eee4b Remove execution driver
We use containerd and there is no execution driver anymore.

Addresses: https://github.com/docker/docker/issues/24461

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
(cherry picked from commit 1fb1136fecfd761300a38f64ac9178979cc0b270)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:18 -07:00
allencloud 25b235a1b1 return err when stack name does not exist
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 416613f2e54581c62d3efa1c4f0288b6e7d58365)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:39 -07:00
Madhu Venugopal b74b71ecb3 fixes #23983
Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 6a4b21bd863f955d05e5df1e54be4dfcf6889870)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:29 -07:00