Now, let's take a quick look at our other stack-related commands through the lens of the swarm where we deployed our voteapp stack. First up, we have the list stacks command: docker stack ls. Giving that a try looks like this:
# List the stacks deployed in a swarm
docker stack ls
Here is what it looks like in the example environment:
This is showing that we have one stack named voteapp currently deployed, and that it is composed of six services and is using swarm mode for its orchestration. Knowing the name of a deploy stack allows us to gather more information about it using the other stack commands. Next up is the list stack tasks command. Let's give this command a try in our example environment:
# List the tasks for our voteapp stack filtered by desried state
docker stack ps voteapp --filter desired-state=running
Here are the results...