This is a local setup using Vagrant with VMware Fusion to demonstrate a Windows Docker swarm-mode. See also
- https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/swarm-mode for latest features in Windows 10 Insider build 15031.
- https://blogs.technet.microsoft.com/virtualization/2017/02/09/overlay-network-driver-with-support-for-docker-swarm-mode-now-available-to-windows-insiders-on-windows-10/
There are three VM's with the following internal network and IP addresses:
VM | IP address | Memory |
---|---|---|
sw-win-01 | 192.168.36.2 | 2GB |
sw-win-02 | 192.168.36.3 | 2GB |
sw-win-03 | 192.168.36.4 | 2GB |
Depending on your host's memory you can spin up one or more Windows Server VM's.
The sw-win-01
is the Swarm manager.
The sw-win-02
and sw-win-03
are Swarm workers.
Open a PowerShell window in the sw-win-01
machine and create a service
PS C:\> docker service create --name=whoami stefanscherer/whoami-windows:latest
Check the service
PS C:\> docker service ls
ID NAME MODE REPLICAS IMAGE
eptkxbn1gce5 whoami replicated 1/1 stefanscherer/whoami-windows:latest
Then scale up the service
PS C:\> docker service scale whoami=10
whoami scaled to 10
PS C:\> docker service ls
ID NAME MODE REPLICAS IMAGE
eptkxbn1gce5 whoami replicated 6/10 stefanscherer/whoami-windows:latest
PS C:\> docker service ls
ID NAME MODE REPLICAS IMAGE
eptkxbn1gce5 whoami replicated 6/10 stefanscherer/whoami-windows:latest
PS C:\> docker service ls
ID NAME MODE REPLICAS IMAGE
eptkxbn1gce5 whoami replicated 10/10 stefanscherer/whoami-windows:latest
Open a PowerShell window on the sw-win-01
machine and run the script
C:\vagrant\scripts\run-visualizer.ps1
Now open a browser to see the visualizer UI. I use the IP address of the manager VM and open a browser on my host machine.
Open a PowerShell window on the sw-win-01
machine and run the script
C:\vagrant\scripts\run-portainer.ps1
Now open a browser to see the Portainer UI. Portainer is started as a Docker service. At the
moment you can't use --publish
on Windows. So we have to pick the IP address of the container
to open it in a browser. Run the helper script
C:\vagrant\scripts\open-portainer-ui.ps1
With both Visualizer and Portainer you could demonstrate scaling services