Reputation: 125
I have come across the word service in many Docker documentations. Does service mean a container? By definition, a container is supposed to perform only one task. Are service and container then to be understood as synonymous?
Upvotes: 3
Views: 188
Reputation: 1329662
The term "service" is originally linked with Docker Swarm
A service is the definition of the tasks to execute on the manager or worker nodes.
It is the central structure of the swarm system and the primary root of user interaction with the swarm.When you create a service, you specify which container image to use and which commands to execute inside running containers.
As mentioned in the Container Network Model:
Endpoint represents a Service Endpoint. It provides the connectivity for services exposed by a container in a network with other services provided by other containers in the network.
Since Endpoint represents a Service and not necessarily a particular container, Endpoint has a global scope within a cluster.
That illustrates a service is not a container, but a way to describe and manage a set of containers (0 to n).
From "How services work":
Upvotes: 4