Docker Swarm on Windows Server. Before you get lost!

  1. You need to have compatible docker images to your Windows OS version of your swarm nodes.
  2. Docker images compatible with Windows Server 2016 will not be compatible with Windows Server 2019 and vice-versa.
  3. If you need to deploy both Linux and Windows containers in the swarm then have both Linux and Windows nodes and utilize placement constraints to guide the deployment correctly.

Windows Server 2016

  1. version 1607 (One and only version with GUI option)
  2. version 1709 (Server core mode only. No GUI option)
  3. version 1803 (Server core mode only. No GUI option)

1. For version 1607 the routing mesh is not supported

docker service create --name web --mode global --publish mode=host,published=80,target=80 microsoft/iis
docker service create --name web --replicas 2 --publish mode=host,target=80 microsoft/iis

2. For version 1709 and beyond routing mesh is supported

3. Docker network endpoint VIP is not supported in windows server 2016

# Deploy a service to the swarm
C:\> docker service create — name=<SERVICENAME> — endpoint-mode dnsrr — network=<NETWORKNAME> <CONTAINERIMAGE> [COMMAND] [ARGS…]
version: '3.3'services:
<service_name1>:
image: <image_name>:<image_tag>
deploy:
mode: global
endpoint_mode: dnsrr
placement:
constraints: [node.labels.windows == true]
ports:
- target: 39830
published: 39830
mode: host
<service_name2>:
image: <image_name>:<image_tag>
deploy:
mode: global
endpoint_mode: dnsrr
placement:
constraints: [node.labels.windows == true]
ports:
- target: 39832
published: 39832
mode: host

Windows Sever 2019

--

--

--

Senior Software Engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

AuroraFS #Airdrop activity is running for 10 DAYS!!!

An Update on Music

What Is Object-Oriented Programming (OOP) and What Are Its Basic Principles?

Free TON Governance 2.0:

Setting up managed OpenShift clusters on Azure with Azure RedHat OpenShift (ARO)

Serious Scrum —Ask the Editors

How to Create an App that Can Stop a Pandemic

Android, CMake and FFmpeg. Part Two: Building FFmpeg

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Thilina Madumal

Thilina Madumal

Senior Software Engineer

More from Medium

How to Install Self-Managed GitLab with Nginx Reverse Proxy and Let’s Encrypt SSL in Ubuntu 20.04

Setting Up Docker on Ubuntu 20.04 Focal (Arm64) Oracle Cloud

Decorators in Python

Flask, from zero to hero: the complete tutorial (work in progress).