- Multi-Host and Multi-Container Orchestration built-in
- Docker Service and Node added to Docker Engine
- Security is built into Swarm by default
- New File format – Distributed Application Bundle (DAB) making it easy to distribute multi-service application stacks between hosts.
Orchestration has become an integral component in the container ecosystem. Actually it so much a key component that Docker has taken the lead and built it directly into the Docker Engine! So what does this mean for our applications?
Starting with Docker 1.12 we now can deploy and manage applications on a Docker Swarm.
Open your CLI and run:
The docker swarm init will activate your current Docker Node (Localhost) and promote it to become the Swarm Manager.
Let’s check the status of our Swarm.
We now have a single node Swarm running on our local machine that quickly. Pat yourself on the back as previously this used to be quite some configuration and typing and now we has been achieved faster than you can finish this sentence.
Docker Service is similar to the Docker Run command. With Docker Service we can now build, distribute, load balance and replicate our service across our Docker Swarm.
Since we have a fresh Docker Swarm running waiting for something to do let’s use the new docker service functionality and create a service and push it to our Swarm.
Let’s create a service which Ping’s our Localhost. We will create the service with only 1 instance (replicas) and afterwords scale our service.
First, create the ping service:
Check the status of our Ping job:
Our service is now running and pinging our Localhost. If you want to see your container running you can still run a $ docker ps to see the container which runs the service.
Docker Service Scale
that our service is running and successfully pinging Localhost let’s scale the ping service. The next command will scale our service from 1 to 3 instances of our process and orchestrate them onto our Swarm.
Scale the ping service:
Let’s check to see if the scaling worked.
We’ve now successfully built a local Docker Swarm on our Docker for Mac/Windows machine, created a service, and scaled this service. With these new features built into the Docker machine it is even easier to deploy distributed, scalable apps across a hybrid or global infrastructure.
Stay tuned as we provide more news from DockerCon. Also, I will take a deep dive of the Docker Service and how we can really use all the benefits combined with Docker Swarm.