The Commands

This lesson lists all the relevant Docker stack commands with brief reminders of what each one does.

  • docker stack deploy is the command for deploying and updating stacks of services defined in a stack file (usually called docker-stack.yml).

  • docker stack ls lists all stacks on the Swarm, including how many services they have.

  • docker stack ps gives detailed information about a deployed stack. It accepts the name of the stack as its main argument, lists which node each replica is running on, and shows desired state and current state.

  • docker stack rm deletes a stack from the Swarm. It does not ask for confirmation before deleting the stack.

Get hands-on with 1000+ tech skills courses.