January 2018
Intermediate to advanced
414 pages
10h 29m
English
Docker service is how we can control the Dockers in our cloud. A service is a set of instances of an existing Docker image that we can manage. We will create a new service based on the Docker alpine image with this command:
docker service create --replicas 1 --name helloworld alpine ping google.com
We can now check how many instances of that service we have in our cloud by using the following command:
docker service ls
This command should give an output that looks something like:
ID NAME MODE REPLICAS IMAGEc9f635ec38fb helloworld replicated 1/1 alpine:latest
And if we want to, we can inspect our services with the following command:
docker service inspect --pretty helloworld
This should show the following as output:
ID: k5krqfpx8e15w91ojmftri9oa ...
Read now
Unlock full access