Commit Graph

59 Commits

Author SHA1 Message Date
c462ad6f63 Fix misleading default for --replicas
This fix tries to address the issue raised in 29291 where
the output of `--replicas` in `service create/update`:
```
      --replicas uint                    Number of tasks (default none)
```
is misleading. User might incorrectly assume the number of replicas
would be `0` (`none`) by default, while the actual default is `1`.

The issue comes from the fact that some of the default values are
from daemon and it is not possible for client to find out the default
value.

In this case, it might be better to just simply not displaying `(default none)`.

This fix returns "" for `Uint64Opt` so that `(default none)` is hidden.

In addition to `--replicas`, this fix also changes
`--restart-delay`, `--restart-max-attempts`, `--stop-grace-period`,
`--health-interval`, `--health-timeout`, and `--restart-window`
in a similiar fashion.

New Output:
```
      --health-interval duration         Time between running the check (ns|us|ms|s|m|h)
      --health-timeout duration          Maximum time to allow one check to run (ns|us|ms|s|m|h)
...
      --replicas uint                    Number of tasks
...
      --restart-delay duration           Delay between restart attempts (ns|us|ms|s|m|h)
      --restart-max-attempts uint        Maximum number of restarts before giving up
      --restart-window duration          Window used to evaluate the restart policy (ns|us|ms|s|m|h)
...
      --stop-grace-period duration       Time to wait before force killing a container (ns|us|ms|s|m|h)
```

The docs has been updated. Note the docs for help output of `service create/update`
is out of sync with the current master. This fix replace with the update-to-date
help output.

This fix fixes 29291.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 87b4281f62
Component: cli
2017-06-02 00:10:45 +00:00
21013bc0e4 Add the link for service logs
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 932211ddc7
Component: cli
2017-06-02 00:10:44 +00:00
84477efeb4 fix typo in reference for service create
Signed-off-by: Trapier Marshall <trapier.marshall@docker.com>
Upstream-commit: e1eea7b951
Component: cli
2017-06-02 00:10:44 +00:00
cdc8c82fea Update reference docs for service ps
commit bbd2018ee19eff5594ae3986bf56fbcd0044699d
changed the output format of `docker service ps`.

this patch updates the reference docs
to match the updated output format.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: baea245377
Component: cli
2017-06-02 00:10:44 +00:00
eb04210a4f Document publishing a UDP port
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 4f414e56d4
Component: cli
2017-06-02 00:10:42 +00:00
4cd5f70633 support src in --secret
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 8628703ce6
Component: cli
2017-06-02 00:10:41 +00:00
db80752229 Add documentation about templating support on…
… services creation/update.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 594b69d1ff
Component: cli
2017-06-02 00:10:40 +00:00
03051a233c cli: Add valid suffixes for remaining duration options
A recent PR added `(ns|us|ms|s|m|h)` to the descriptions of some
duration options, but not all. Add it to the remaining options for
consistency.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 53ef5c34c0
Component: cli
2017-06-02 00:10:39 +00:00
aacf361c84 Add flag --host to service create and --host-add/--host-rm to service update
This fix tries to address 27902 by adding a flag `--host`
to `docker service create` and `--host-add/--host-rm` to
`docker service update`, so that it is possible to
specify extra `host:ip` settings in `/etc/hosts`.

This fix adds `Hosts` in swarmkit's `ContainerSpec` so that it
is possible to specify extra hosts during service creation.

Related docs has been updated.

An integration test has been added.

This fix fixes 27902.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 9cda7c331e
Component: cli
2017-06-02 00:10:37 +00:00
890a070951 Add --dns-option to docker run and hide --dns-opt
This fix is a follow up to #27567 based on:
https://github.com/docker/docker/pull/27567#issuecomment-259295055

In #27567, `--dns-options` has been added to `service create/update`,
together with `--dns` and `--dns-search`. The `--dns-opt` was used
in `docker run`.

This fix add `--dns-option` (not `--dns-options`) to `docker run/create`, and hide
`--dns-opt`. It is still possible to use `--dns-opt` with
`docker run/create`, though it will not show up in help output.

This fix change `--dns-options`to --dns-option` for `docker service create`
and `docker service update`.

This fix also updates the docs and bash/zsh completion scripts.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: ebacbb50ae
Component: cli
2017-06-02 00:10:36 +00:00
0b30168718 opts/mount: add tmpfs-specific options
added following options:

 * tmpfs-size
 * tmpfs-mode

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: ad1fe309ec
Component: cli
2017-06-02 00:10:36 +00:00
d328fe3c72 secrets: support simple syntax --secret foo
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: a5875e1a56
Component: cli
2017-06-02 00:10:36 +00:00
f1e73fbc24 secrets: use explicit format when using secrets
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 32a96e4fa4
Component: cli
2017-06-02 00:10:36 +00:00
a5adcda0d8 doc review updates
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: f0026b6e12
Component: cli
2017-06-02 00:10:36 +00:00
3dcc71e152 docs: update cli reference for secret usage
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

docs: minor update to service create usage

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 2161bbf176
Component: cli
2017-06-02 00:10:36 +00:00
dc9be3e076 Remove -ptr from the help output of service create
This fix is based on the comment:
https://github.com/docker/docker/pull/28147#discussion_r86996347

Previously the output string of the `DurationOpt` is `duration-ptr`
and `Uint64Opt` is `uint64-ptr`. While it is clear to developers,
for a normal user `-ptr` might not be very informative.

On the other hand, the default value of `DurationOpt` and `Uint64Opt`
has already been quite informative: `none`. That means if no flag
provided, the value will be treated as none.
(like a ptr with nil as the default)

For that reason this fix removes the `-ptr`.

Also, the output in the docs of `service create` has been quite
out-of-sync with the true output. So this fix updates the docs
to have the most up-to-date help output of `service create --help`.

This fix is related to #28147.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: ac4b6e3505
Component: cli
2017-06-02 00:10:36 +00:00
f57706bf47 Fixes #24083 : Improving cli help for flags with duration option
Signed-off-by: milindchawre <milindchawre@gmail.com>
Upstream-commit: 7d90a06417
Component: cli
2017-06-02 00:10:35 +00:00
0aeba134e4 Add custom DNS settings to service update
This fix adds `--dns-add`, `--dns-rm`, `--dns-opt-add`, `--dns-opt-rm`,
`--dns-search-add` and `--dns-search-rm` to `service update`.

An integration test and a unit test have been added to cover the changes in this fix.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 6355071b17
Component: cli
2017-06-02 00:10:34 +00:00
cf388afdfa Add custom DNS settings to service definition
This fix tries to fix the issue raised in 24391 about allowing
custom DNS settings to service definition.

This fix adds `DNSConfig` (`Nameservers`, `Options`, `Search`) to
service definition, as well as `--dns`, `--dns-opt`, and `dns-search`
to `service create`.

An integration test has been added to cover the changes in this fix.

This fix fixes 24391.

A PR in swarmkit will be created separately.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 80fb5e93ee
Component: cli
2017-06-02 00:10:34 +00:00
3d48ab983d support show numbers of global service in service ls command
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 5af84edf26
Component: cli
2017-06-02 00:10:34 +00:00
233e18f1ff Add --tty to docker service create/update
This fix tries to add `--tty` to `docker service create/update`. As was
specified in 25644, `TTY` flag has been added to SwarmKit and is
already vendored.

This fix add `--tty` to `docker service create/update`.

Related document has been updated.

Additional integration tests has been added.

This fix fixes 25644.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 7443d74e2d
Component: cli
2017-06-02 00:10:33 +00:00
acbe6a8c1a remove COMMAND column from service ls output. closes #27994
Signed-off-by: Alicia Lauerman <alicia@eta.im>
Upstream-commit: 5ad8af8fd1
Component: cli
2017-06-02 00:10:32 +00:00
7512a6b872 Adding the hostname option to docker service command
Signed-off-by: Nikolay Milovanov <nmil@itransformers.net>
Upstream-commit: ea6fc78b8f
Component: cli
2017-06-02 00:10:32 +00:00
35146fe359 fix frontmatter keywords value type (string, instead of []string) in /docs/reference
Signed-off-by: Gaetan de Villele <gdevillele@gmail.com>
Upstream-commit: 572c6bb89a
Component: cli
2017-06-02 00:10:31 +00:00
f4590ea5c1 cli: add --mount to docker run
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 0e7bbb55c8
Component: cli
2017-06-02 00:10:31 +00:00
18c108f9d5 Service create --group param
--group-add was used for specifying groups for both service create
and service update. For create it was confusing since we don't have
an existing set of groups. Instead I added --group to create, and
moved --group-add to service update only, like --group-rm
This deals with issue 27646

Signed-off-by: Lily Guo <lily.guo@docker.com>

Update flag documentation

Specify that --group, --group-add and --groupd-rm refers to
supplementary user groups

Signed-off-by: Lily Guo <lily.guo@docker.com>

Fix docs for groups and update completion scripts

Signed-off-by: Lily Guo <lily.guo@docker.com>
Upstream-commit: 0e1a3f6bbb
Component: cli
2017-06-02 00:10:30 +00:00
0a2fb5212e Add --health-* commands to service create and update
A HealthConfig entry was added to the ContainerSpec associated with the
service being created or updated.

Signed-off-by: Cezar Sa Espinola <cezarsa@gmail.com>
Upstream-commit: 836b1a7d0a
Component: cli
2017-06-02 00:10:30 +00:00
192d15ece1 Add --env-file flag to docker create service
This fix tries to address the issue in 24712 and add
`--env-file` file to `docker create service`.

Related documentation has been updated.

An additional integration has been added.

This fix fixes 24712.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 5acd85c6e8
Component: cli
2017-06-02 00:10:29 +00:00
94ac28a2ac Fix the incorrect links in the document about network and service
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 4df7e0a9fa
Component: cli
2017-06-02 00:10:28 +00:00
118bce70c4 Sync docker/docker refs with files mistakenly edited in docker.github.io repo
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 7f36c3a1a0
Component: cli
2017-06-02 00:10:26 +00:00
8308c17bab Service update failure thresholds and rollback
This adds support for two enhancements to swarm service rolling updates:

- Failure thresholds: In Docker 1.12, a service update could be set up
  to either pause or continue after a single failure occurs. This adds
  an --update-max-failure-ratio flag that controls how many tasks need to
  fail to update for the update as a whole to be considered a failure. A
  counterpart flag, --update-monitor, controls how long to monitor each
  task for a failure after starting it during the update.

- Rollback flag: service update --rollback reverts the service to its
  previous version. If a service update encounters task failures, or
  fails to function properly for some other reason, the user can roll back
  the update.

SwarmKit also has the ability to roll back updates automatically after
hitting the failure thresholds, but we've decided not to expose this in
the Docker API/CLI for now, favoring a workflow where the decision to
roll back is always made by an admin. Depending on user feedback, we may
add a "rollback" option to --update-failure-action in the future.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 8c03c1201b
Component: cli
2017-06-02 00:10:25 +00:00
fbc93c2df5 Convert Markdown frontmatter to YAML
Some frontmatter such as the weights, menu stuff, etc is no longer used
'draft=true' becomes 'published: false'

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
Upstream-commit: 2845676cc2
Component: cli
2017-06-02 00:10:24 +00:00
7f53df54e5 Fix Markdown formatting and missing prompt in service create
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: efe94b9d92
Component: cli
2017-06-02 00:10:10 +00:00
8f9d913e06 Misty's edits and additions
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit 3de7d725137ee1620ae2050e65ace4990a3af87e)
Upstream-commit: b3341fb7af
Component: cli
2017-06-02 00:10:10 +00:00
b97b39887c Add --mount syntax documentation to CLI reference
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 060fd9fa5c
Component: cli
2017-06-02 00:10:10 +00:00
713d904c3b carries and closes 25414
Signed-off-by: Charles Smith <charles.smith@docker.com>
Upstream-commit: 63478d277a
Component: cli
2017-06-02 00:10:09 +00:00
e229f42f04 Update service_create.md
More info on endpoint setting, and service discovery on swarm mode overlay network.

Signed-off-by: Richard Mathie <richard.mathie@amey.co.uk>
Upstream-commit: 9163eecf91
Component: cli
2017-06-02 00:10:09 +00:00
96cfa92653 update docs/reference/commandline/service_create.md
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: d602486346
Component: cli
2017-06-02 00:10:08 +00:00
2fc8c0080b Support --group-add and --group-rm in docker service create/update
This fix tries to address the issue raised in 25304 to support
`--group-add` and `--group-rm` in `docker service create`.

This fix adds `--group-add` to `docker service create` and `docker service update`,
adds `--group-rm` to `docker service update`.

This fix updates docs for `docker service create` and `docker service update`:
1. Add `--group-add` to `docker service create` and `docker service update`
2. Add `--group-rm` to `docker service update`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: c37fcc3f49
Component: cli
2017-06-02 00:10:07 +00:00
0c110248c9 Update docs in docker service create/update for flag --user
In `docker service create/update`, flag `--user` actually supports
`uid:gid` (same as `docker run`). However, this is not reflected
in the help and documentation yet.

This fix updates docs in `docker service create/update` to change
the description to `Username or UID (format: <name|uid>[:<group|gid>])`.

The help message output has also been updated.

This fix is related to 25304.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: aee09a390b
Component: cli
2017-06-02 00:10:03 +00:00
2278db9d39 cli: docker service|node|stack ps instead of tasks
Rather than conflict with the unexposed task model, change the names of
the object-oriented task display to `docker <object> ps`. The command
works identically to `docker service tasks`. This change is superficial.

This provides a more sensical docker experience while not trampling on
the task model that may be introduced as a top-level command at a later
date.

The following is an example of the display using `docker service ps`
with a service named `condescending_cori`:

```
$ docker service ps condescending_cori
ID                         NAME                  SERVICE             IMAGE   LAST STATE              DESIRED STATE  NODE
e2cd9vqb62qjk38lw65uoffd2  condescending_cori.1  condescending_cori  alpine  Running 13 minutes ago  Running        6c6d232a5d0e
```

The following shows the output for the node on which the command is
running:

```console
$ docker node ps self
ID                         NAME                  SERVICE             IMAGE   LAST STATE              DESIRED STATE  NODE
b1tpbi43k1ibevg2e94bmqo0s  mad_kalam.1           mad_kalam           apline  Accepted 2 seconds ago  Accepted       6c6d232a5d0e
e2cd9vqb62qjk38lw65uoffd2  condescending_cori.1  condescending_cori  alpine  Running 12 minutes ago  Running        6c6d232a5d0e
4x609m5o0qyn0kgpzvf0ad8x5  furious_davinci.1     furious_davinci     redis   Running 32 minutes ago  Running        6c6d232a5d0e
```

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 9d114f0fae
Component: cli
2017-06-02 00:10:03 +00:00
e48cec13d7 Remove release-candidate advisories
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 00a430d255
Component: cli
2017-06-02 00:10:03 +00:00
106ca6fb0a 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>
Upstream-commit: 91e476b7e9
Component: cli
2017-06-02 00:10:03 +00:00
4594082206 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>
Upstream-commit: b41c3dd208
Component: cli
2017-06-02 00:10:02 +00:00
b0dc49bd20 Update --update-parallelism docs
Update documentation to account for the changes in #24952.

docs/swarm/swarm-tutorial/rolling-update.md doesn't need any changes,
but the CLI reference pages should show the current help text.
drain-node.md no longer needs to specify --update-parallelism 1 in its
example.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 012fa2fd1b
Component: cli
2017-06-02 00:10:02 +00:00
a677374f33 Append --registry-auth with with
`--with-registry-auth` is more explicit.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 2f9e9bcbaa
Component: cli
2017-06-02 00:10:02 +00:00
e128f0ccd5 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>
Upstream-commit: acf0bc4b9a
Component: cli
2017-06-02 00:10:02 +00:00
b76715195d Add missing --log-driver and --log-opt docs
Adds documentation for "--log-driver" and "--log-opt"
for services.

Also updated the API docs to include the new
options, and generated a more complete JSON
example.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: c8dd8fe523
Component: cli
2017-06-02 00:10:01 +00:00
88bdaca178 add ref docs for node label
Signed-off-by: Charles Smith <charles.smith@docker.com>
Upstream-commit: 59b234a119
Component: cli
2017-06-02 00:10:01 +00:00
a7e6ee6b34 docs: correct the placement constraints docker service example
- the constraint expression needs to be quoted
- add an actual redis container to run so the command line works

Signed-off-by: Anil Madhavapeddy <anil@docker.com>
Upstream-commit: d41a63b2c0
Component: cli
2017-06-02 00:07:51 +00:00