Docker Swarm with Linux and Windows

As soon as you need to run containers in any form more available or production-ready configuration, you're going to need to have more than one Docker engine host OS/VM/node where the containers can run.  In this post and embeded three-part video series I did with Dongluo Chen from Docker we will address how Docker Swarm helps to solve some challenges you will need to address when running in a more availalable or production-ready configuration, including:

  • Which Docker engine node should I run my next container on?
  • Will the Docker engine node have enough capacity / resources available or proper host OS software installed (i.e. on Windows or Linux) to meet the container's requirements to run?
  • What if I keep adding and removing Docker engine nodes - how will I keep track of them all?
  • How can I make my containerized application be balanced across multiple Docker engine node hosts?
  • If a Docker engine node fails - how will I handle this?

Docker Swarm comes to the rescue! Docker Swarm is a clustering and scheduling tool for Docker containers.  Swarm establishes and manages a cluster of Docker nodes as a single virtual system.  One of the big benefits of Swarm is it allows people to use the native Docker commands they are familiar with to run containers.  It should also be duly noted that Swarm needs to be paired with a separate technology for things like node leader election and discovery to truly be effective.  One such option is Consul but see here for other alternative comparisons.

Docker Swarm is supported in Microsoft Azure and can be deployed easily using these two Azure resource manager deployment templates which already have the highly-available baseline configuration details worked out for you:
1) Using CoreOS as the host OS and Consul
2) Using Azure Container Service with Swarm

Below is Part 1 of the video interview with Docker engineer @Dongluochen walking through how to run the 1st option on Azure.

Link to source video on Channel 9

Now that you have a highly available Swarm Cluster, how might you go about adding a Windows Server 2016 Docker engine host node to be available in the Swarm cluster?  This would enable you to provision Windows-based containers through Swarm.  This is exactly what we cover in this part 2 video with Dongluo:

Link to source video on Channel 9

Did you know that you can have Windows Server 2012 R2 run as host nodes in a Swarm cluster?
If you'd like to learn - watch this Part 3 demonstration of how to create swarm binaries for Windows Server and to join the Windows Server as a part of the Swarm cluster.

For more information:

David Tesar - @dtzar