Update command usage and documentation

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2018-06-21 23:16:27 -07:00
parent a63252ba71
commit 0f07b9ffc7
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
12 changed files with 51 additions and 27 deletions

View File

@ -102,7 +102,7 @@ func managementSubCommands(cmd *cobra.Command) []*cobra.Command {
var usageTemplate = `Usage:
{{- if not .HasSubCommands}} {{.UseLine}}{{end}}
{{- if .HasSubCommands}} {{ .CommandPath}} COMMAND{{end}}
{{- if .HasSubCommands}} {{ .CommandPath}}{{- if .HasAvailableFlags}} [OPTIONS]{{end}} COMMAND{{end}}
{{ .Short | trim }}

View File

@ -23,7 +23,7 @@ type commonOptions struct {
func NewStackCommand(dockerCli command.Cli) *cobra.Command {
var opts commonOptions
cmd := &cobra.Command{
Use: "stack",
Use: "stack [OPTIONS]",
Short: "Manage Docker stacks",
Args: cli.NoArgs,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {

View File

@ -17,7 +17,7 @@ func newListCommand(dockerCli command.Cli, common *commonOptions) *cobra.Command
opts := options.List{}
cmd := &cobra.Command{
Use: "ls",
Use: "ls [OPTIONS]",
Aliases: []string{"list"},
Short: "List stacks",
Args: cli.NoArgs,

View File

@ -13,7 +13,7 @@ func newRemoveCommand(dockerCli command.Cli, common *commonOptions) *cobra.Comma
var opts options.Remove
cmd := &cobra.Command{
Use: "rm STACK [STACK...]",
Use: "rm [OPTIONS] STACK [STACK...]",
Aliases: []string{"remove", "down"},
Short: "Remove one or more stacks",
Args: cli.RequiresMinArgs(1),

View File

@ -66,6 +66,7 @@ by the `docker` command line:
* `DOCKER_NOWARN_KERNEL_VERSION` Prevent warnings that your Linux kernel is
unsuitable for Docker.
* `DOCKER_RAMDISK` If set this will disable 'pivot_root'.
* `DOCKER_STACK_ORCHESTRATOR` Configure the default orchestrator to use when using `docker stack` management commands.
* `DOCKER_TLS` When set Docker uses TLS.
* `DOCKER_TLS_VERIFY` When set Docker uses TLS and verifies the remote.
* `DOCKER_CONTENT_TRUST` When set Docker uses notary to sign and verify images.
@ -196,6 +197,11 @@ credentials for specific registries. If this property is set, the binary
for a specific registry. For more information, see the
[**Credential helpers** section in the `docker login` documentation](login.md#credential-helpers)
The property `stackOrchestrator` specifies the default orchestrator to use when
running `docker stack` management commands. Valid values are `"swarm"`,
`"kubernetes"`, and `"all"`. This property can be overridden with the
`DOCKER_STACK_ORCHESTRATOR` environment variable, or the `--orchestrator` flag.
Once attached to a container, users detach from it and leave it running using
the using `CTRL-p CTRL-q` key sequence. This detach key sequence is customizable
using the `detachKeys` property. Specify a `<sequence>` value for the
@ -236,7 +242,8 @@ Following is a sample `config.json` file:
"credHelpers": {
"awesomereg.example.org": "hip-star",
"unicorn.example.com": "vcbait"
}
},
"stackOrchestrator": "kubernetes"
}
{% endraw %}
```

View File

@ -16,18 +16,20 @@ keywords: "stack"
# stack
```markdown
Usage: docker stack COMMAND
Usage: docker stack [OPTIONS] COMMAND
Manage Docker stacks
Options:
--help Print usage
--help Print usage
--kubeconfig string Kubernetes config file
--orchestrator string Orchestrator to use (swarm|kubernetes|all)
Commands:
deploy Deploy a new stack or update an existing stack
ls List stacks
ps List the tasks in the stack
rm Remove the stack
rm Remove one or more stacks
services List the services in the stack
Run 'docker stack COMMAND --help' for more information on a command.

View File

@ -27,6 +27,9 @@ Options:
--bundle-file string Path to a Distributed Application Bundle file
-c, --compose-file strings Path to a Compose file
--help Print usage
--kubeconfig string Kubernetes config file
--namespace string Kubernetes namespace to use
--orchestrator string Orchestrator to use (swarm|kubernetes|all)
--prune Prune services that are no longer referenced
--resolve-image string Query the registry to resolve image digest and supported platforms
("always"|"changed"|"never") (default "always")

View File

@ -16,7 +16,7 @@ keywords: "stack, ls"
# stack ls
```markdown
Usage: docker stack ls
Usage: docker stack ls [OPTIONS]
List stacks
@ -24,8 +24,11 @@ Aliases:
ls, list
Options:
--help Print usage
--format string Pretty-print stacks using a Go template
--help Print usage
--format string Pretty-print stacks using a Go template
--kubeconfig string Kubernetes config file
--namespace string Kubernetes namespace to use
--orchestrator string Orchestrator to use (swarm|kubernetes|all)
```
## Description

View File

@ -21,12 +21,15 @@ Usage: docker stack ps [OPTIONS] STACK
List the tasks in the stack
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print tasks using a Go template
--help Print usage
--no-resolve Do not map IDs to Names
--no-trunc Do not truncate output
-q, --quiet Only display task IDs
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print tasks using a Go template
--help Print usage
--kubeconfig string Kubernetes config file
--namespace string Kubernetes namespace to use
--no-resolve Do not map IDs to Names
--no-trunc Do not truncate output
--orchestrator string Orchestrator to use (swarm|kubernetes|all)
-q, --quiet Only display task IDs
```
## Description

View File

@ -16,7 +16,7 @@ keywords: "stack, rm, remove, down"
# stack rm
```markdown
Usage: docker stack rm STACK [STACK...]
Usage: docker stack rm [OPTIONS] STACK [STACK...]
Remove one or more stacks
@ -24,7 +24,10 @@ Aliases:
rm, remove, down
Options:
--help Print usage
--help Print usage
--kubeconfig string Kubernetes config file
--namespace string Kubernetes namespace to use
--orchestrator string Orchestrator to use (swarm|kubernetes|all)
```
## Description

View File

@ -2,7 +2,6 @@
title: "stack services"
description: "The stack services command description and usage"
keywords: "stack, services"
advisory: "experimental"
---
<!-- This file is maintained within the docker/cli GitHub
@ -14,7 +13,7 @@ advisory: "experimental"
will be rejected.
-->
# stack services (experimental)
# stack services
```markdown
Usage: docker stack services [OPTIONS] STACK
@ -22,10 +21,13 @@ Usage: docker stack services [OPTIONS] STACK
List the services in the stack
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print services using a Go template
--help Print usage
-q, --quiet Only display IDs
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print services using a Go template
--help Print usage
--kubeconfig string Kubernetes config file
--namespace string Kubernetes namespace to use
--orchestrator string Orchestrator to use (swarm|kubernetes|all)
-q, --quiet Only display IDs
```
## Description

View File

@ -21,8 +21,9 @@ Usage: docker version [OPTIONS]
Show the Docker version information
Options:
-f, --format string Format the output using the given Go template
--help Print usage
-f, --format string Format the output using the given Go template
--help Print usage
-k, --kubeconfig string Kubernetes config file
```
## Description