-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Hands-On Microservices with Kotlin
By :

Now that our swarm is ready, we can use it to create services that we can use for scaling, but first, we will create a shared registry in our swarm. Then, we will build a microservice and publish it into a Docker. Finally, we will learn how to scale our microservice and how to control it.
When we create a swarm's service, we specify an image that will be used, but when we ask Docker to create the instances of the service, it will use the swarm master node to do it.
If we have built our Docker images in our machine, they are not available on the master node of the swarm, so it will create a registry service that we can use to publish our images and reference when we create our own services.
First, let's create the registry service:
docker service create --name registry --publish 5000:5000 registry
Now, if we list our services, we should see our registry created:
docker service ls ID NAME MODE REPLICAS IMAGE ...