github.com/jiasir/docker@v1.3.3-0.20170609024000-252e610103e7/docs/reference/commandline/stack_ls.md (about) 1 --- 2 title: "stack ls" 3 description: "The stack ls command description and usage" 4 keywords: "stack, ls" 5 --- 6 7 <!-- This file is maintained within the docker/docker Github 8 repository at https://github.com/docker/docker/. Make all 9 pull requests against that repo. If you see this file in 10 another repository, consider it read-only there, as it will 11 periodically be overwritten by the definitive file. Pull 12 requests which include edits to this file in other repositories 13 will be rejected. 14 --> 15 16 # stack ls 17 18 ```markdown 19 Usage: docker stack ls 20 21 List stacks 22 23 Aliases: 24 ls, list 25 26 Options: 27 --help Print usage 28 --format string Pretty-print stacks using a Go template 29 ``` 30 31 ## Description 32 33 Lists the stacks. 34 35 ## Examples 36 37 The following command shows all stacks and some additional information: 38 39 ```bash 40 $ docker stack ls 41 42 ID SERVICES 43 vossibility-stack 6 44 myapp 2 45 ``` 46 47 ### Formatting 48 49 The formatting option (`--format`) pretty-prints stacks using a Go template. 50 51 Valid placeholders for the Go template are listed below: 52 53 | Placeholder | Description | 54 | ----------- | ------------------ | 55 | `.Name` | Stack name | 56 | `.Services` | Number of services | 57 58 When using the `--format` option, the `stack ls` command either outputs 59 the data exactly as the template declares or, when using the 60 `table` directive, includes column headers as well. 61 62 The following example uses a template without headers and outputs the 63 `Name` and `Services` entries separated by a colon for all stacks: 64 65 ```bash 66 $ docker stack ls --format "{{.Name}}: {{.Services}}" 67 web-server: 1 68 web-cache: 4 69 ``` 70 71 ## Related commands 72 73 * [stack deploy](stack_deploy.md) 74 * [stack ps](stack_ps.md) 75 * [stack rm](stack_rm.md) 76 * [stack services](stack_services.md)