What is the difference between docker service and stack?

Viewed 14014

I am wondering what the difference between such things. They have got almost the same commands and give the same result.

3 Answers

A Service defines one or more instances of a single image deployed on one or more machines (described by one entry in the services part of the docker-compose.yaml files).

A Stack defines a group of heterogeneous services (described by the whole yaml file).

The semantics of docker stack deploy can simplify your release automation process because it will automatically detect and update an existing service. When using docker service you must specify whether to create or update the service which could require more complex logic.

See also:

Related