Stacks in Docker Swarm address the limitations of using Docker Compose with a single host, or creating services manually on a Docker Swarm. You create a stack from a Compose file, and Docker stores all the metadata for the stack's services in the swarm. This means Docker is aware that the set of resources represents one application, and you can manage services from any Docker client without needing the Compose file.
A stack is an abstraction over all the objects that make up your application. It contains services, volumes, and networks just like a standard Docker Compose file, but it also supports Docker Swarm objects—configs and secrets—and additional deployment settings for running applications at scale.
Stacks can even abstract the orchestrator you're using. Docker Enterprise supports both Docker Swarm and Kubernetes...