From ac4b6e35056b8a99993919411421e5a5fb2f30e9 Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Tue, 8 Nov 2016 07:06:07 -0800 Subject: [PATCH] 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 --- docs/reference/commandline/service_create.md | 48 ++++----- docs/reference/commandline/service_update.md | 104 +++++++++---------- 2 files changed, 76 insertions(+), 76 deletions(-) diff --git a/docs/reference/commandline/service_create.md b/docs/reference/commandline/service_create.md index c058616a07..d659a60d19 100644 --- a/docs/reference/commandline/service_create.md +++ b/docs/reference/commandline/service_create.md @@ -21,48 +21,48 @@ Usage: docker service create [OPTIONS] IMAGE [COMMAND] [ARG...] Create a new service Options: - --constraint value Placement constraints (default []) - --container-label value Service container labels (default []) + --constraint list Placement constraints (default []) + --container-label list Container labels (default []) --dns list Set custom DNS servers (default []) --dns-options list Set DNS options (default []) --dns-search list Set custom DNS search domains (default []) --endpoint-mode string Endpoint mode (vip or dnsrr) - -e, --env value Set environment variables (default []) - --env-file value Read in a file of environment variables (default []) - --group value Set one or more supplementary user groups for the container (default []) + -e, --env list Set environment variables (default []) + --env-file list Read in a file of environment variables (default []) + --group list Set one or more supplementary user groups for the container (default []) --health-cmd string Command to run to check health - --health-interval duration Time between running the check (ns|us|ms|s|m|h) (default 0s) + --health-interval duration Time between running the check (default none) --health-retries int Consecutive failures needed to report unhealthy - --health-timeout duration Maximum time to allow one check to run (ns|us|ms|s|m|h) (default 0s) + --health-timeout duration Maximum time to allow one check to run (default none) --help Print usage - --hostname Service containers hostname - -l, --label value Service labels (default []) - --limit-cpu value Limit CPUs (default 0.000) - --limit-memory value Limit Memory (default 0 B) + --hostname string Container hostname + -l, --label list Service labels (default []) + --limit-cpu decimal Limit CPUs (default 0.000) + --limit-memory bytes Limit Memory (default 0 B) --log-driver string Logging driver for service - --log-opt value Logging driver options (default []) + --log-opt list Logging driver options (default []) --mode string Service mode (replicated or global) (default "replicated") - --mount value Attach a filesystem mount to the service + --mount mount Attach a filesystem mount to the service --name string Service name - --network value Network attachments (default []) + --network list Network attachments (default []) --no-healthcheck Disable any container-specified HEALTHCHECK - -p, --publish value Publish a port as a node port (default []) - --replicas value Number of tasks (default none) - --reserve-cpu value Reserve CPUs (default 0.000) - --reserve-memory value Reserve Memory (default 0 B) + -p, --publish list Publish a port as a node port (default []) + --replicas uint Number of tasks (default none) + --reserve-cpu decimal Reserve CPUs (default 0.000) + --reserve-memory bytes Reserve Memory (default 0 B) --restart-condition string Restart when condition is met (none, on-failure, or any) - --restart-delay value Delay between restart attempts (default none) - --restart-max-attempts value Maximum number of restarts before giving up (default none) - --restart-window value Window used to evaluate the restart policy (default none) - --stop-grace-period value Time to wait before force killing a container (default none) + --restart-delay duration Delay between restart attempts (default none) + --restart-max-attempts uint Maximum number of restarts before giving up (default none) + --restart-window duration Window used to evaluate the restart policy (default none) + --stop-grace-period duration Time to wait before force killing a container (default none) -t, --tty Allocate a pseudo-TTY --update-delay duration Delay between updates (ns|us|ms|s|m|h) (default 0s) --update-failure-action string Action on update failure (pause|continue) (default "pause") - --update-max-failure-ratio value Failure rate to tolerate during an update + --update-max-failure-ratio float Failure rate to tolerate during an update --update-monitor duration Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 0s) --update-parallelism uint Maximum number of tasks updated simultaneously (0 to update all at once) (default 1) -u, --user string Username or UID (format: [:]) - --with-registry-auth Send registry authentication details to Swarm agents + --with-registry-auth Send registry authentication details to swarm agents -w, --workdir string Working directory inside the container ``` diff --git a/docs/reference/commandline/service_update.md b/docs/reference/commandline/service_update.md index bf40aa4446..f321b31ddc 100644 --- a/docs/reference/commandline/service_update.md +++ b/docs/reference/commandline/service_update.md @@ -21,58 +21,58 @@ Usage: docker service update [OPTIONS] SERVICE Update a service Options: - --args string Service command args - --constraint-add stringSlice Add or update a placement constraint - --constraint-rm list Remove a constraint (default []) - --container-label-add list Add or update a container label (default []) - --container-label-rm list Remove a container label by its key (default []) - --dns-add list Add or update custom DNS servers (default []) - --dns-options-add list Add or update DNS options (default []) - --dns-options-rm list Remove DNS options (default []) - --dns-rm list Remove custom DNS servers (default []) - --dns-search-add list Add or update custom DNS search domains (default []) - --dns-search-rm list Remove DNS search domains (default []) - --endpoint-mode string Endpoint mode (vip or dnsrr) - --env-add list Add or update an environment variable (default []) - --env-rm list Remove an environment variable (default []) - --force Force update even if no changes require it - --group-add stringSlice Add an additional supplementary user group to the container - --group-rm list Remove a previously added supplementary user group from the container (default []) - --health-cmd string Command to run to check health - --health-interval duration Time between running the check (ns|us|ms|s|m|h) (default 0s) - --health-retries int Consecutive failures needed to report unhealthy - --health-timeout duration Maximum time to allow one check to run (ns|us|ms|s|m|h) (default 0s) - --help Print usage - --image string Service image tag - --label-add list Add or update a service label (default []) - --label-rm list Remove a label by its key (default []) - --limit-cpu NanoCPUs Limit CPUs (default 0.000) - --limit-memory MemoryBytes Limit Memory (default 0 B) - --log-driver string Logging driver for service - --log-opt list Logging driver options (default []) - --mount-add mount Add or update a mount on a service - --mount-rm list Remove a mount by its target path (default []) - --no-healthcheck Disable any container-specified HEALTHCHECK - --publish-add list Add or update a published port (default []) - --publish-rm list Remove a published port by its target port (default []) - --replicas uint64-ptr Number of tasks (default none) - --reserve-cpu NanoCPUs Reserve CPUs (default 0.000) - --reserve-memory MemoryBytes Reserve Memory (default 0 B) - --restart-condition string Restart when condition is met (none, on-failure, or any) - --restart-delay duration-ptr Delay between restart attempts (default none) - --restart-max-attempts uint64-ptr Maximum number of restarts before giving up (default none) - --restart-window duration-ptr Window used to evaluate the restart policy (default none) - --rollback Rollback to previous specification - --stop-grace-period duration-ptr Time to wait before force killing a container (default none) - -t, --tty Allocate a pseudo-TTY - --update-delay duration Delay between updates (ns|us|ms|s|m|h) (default 0s) - --update-failure-action string Action on update failure (pause|continue) (default "pause") - --update-max-failure-ratio float32 Failure rate to tolerate during an update - --update-monitor duration Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 0s) - --update-parallelism uint Maximum number of tasks updated simultaneously (0 to update all at once) (default 1) - -u, --user string Username or UID (format: [:]) - --with-registry-auth Send registry authentication details to swarm agents - -w, --workdir string Working directory inside the container + --args string Service command args + --constraint-add list Add or update a placement constraint (default []) + --constraint-rm list Remove a constraint (default []) + --container-label-add list Add or update a container label (default []) + --container-label-rm list Remove a container label by its key (default []) + --dns-add list Add or update custom DNS servers (default []) + --dns-options-add list Add or update DNS options (default []) + --dns-options-rm list Remove DNS options (default []) + --dns-rm list Remove custom DNS servers (default []) + --dns-search-add list Add or update custom DNS search domains (default []) + --dns-search-rm list Remove DNS search domains (default []) + --endpoint-mode string Endpoint mode (vip or dnsrr) + --env-add list Add or update an environment variable (default []) + --env-rm list Remove an environment variable (default []) + --force Force update even if no changes require it + --group-add list Add an additional supplementary user group to the container (default []) + --group-rm list Remove a previously added supplementary user group from the container (default []) + --health-cmd string Command to run to check health + --health-interval duration Time between running the check (default none) + --health-retries int Consecutive failures needed to report unhealthy + --health-timeout duration Maximum time to allow one check to run (default none) + --help Print usage + --image string Service image tag + --label-add list Add or update a service label (default []) + --label-rm list Remove a label by its key (default []) + --limit-cpu decimal Limit CPUs (default 0.000) + --limit-memory bytes Limit Memory (default 0 B) + --log-driver string Logging driver for service + --log-opt list Logging driver options (default []) + --mount-add mount Add or update a mount on a service + --mount-rm list Remove a mount by its target path (default []) + --no-healthcheck Disable any container-specified HEALTHCHECK + --publish-add list Add or update a published port (default []) + --publish-rm list Remove a published port by its target port (default []) + --replicas uint Number of tasks (default none) + --reserve-cpu decimal Reserve CPUs (default 0.000) + --reserve-memory bytes Reserve Memory (default 0 B) + --restart-condition string Restart when condition is met (none, on-failure, or any) + --restart-delay duration Delay between restart attempts (default none) + --restart-max-attempts uint Maximum number of restarts before giving up (default none) + --restart-window duration Window used to evaluate the restart policy (default none) + --rollback Rollback to previous specification + --stop-grace-period duration Time to wait before force killing a container (default none) + -t, --tty Allocate a pseudo-TTY + --update-delay duration Delay between updates (ns|us|ms|s|m|h) (default 0s) + --update-failure-action string Action on update failure (pause|continue) (default "pause") + --update-max-failure-ratio float Failure rate to tolerate during an update + --update-monitor duration Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 0s) + --update-parallelism uint Maximum number of tasks updated simultaneously (0 to update all at once) (default 1) + -u, --user string Username or UID (format: [:]) + --with-registry-auth Send registry authentication details to swarm agents + -w, --workdir string Working directory inside the container ``` Updates a service as described by the specified parameters. This command has to be run targeting a manager node.