Search code examples
dockercontainersdocker-swarmwindows-container

Will my windows container work on linux worker node in swarm?


Appreciate an expert advise. We have a Docker EE setup on RH Linux platform.

Given that we have setup Docker EE as:

  • 2 manager nodes (linux)
  • 2 worker nodes (linux)
  • 2 worker node (windows server)
  • UCP
  • Docker Swarm

When I build a windows container to run a .NET console service built on .NET 4.6.2. How this container gets allocated in the swarm?

Questions: How will this be able to join the swarm?

Will my container be able to run on the worker nodes running Linux host OS? How docker swarm manage the fail-over of the nodes? Will the replica only gets distributed on the windows worker nodes? Is this setup of ours make sense?

I had some readings that windows containers only runs on Windows host but Linux containers can run both Linux and Windows host nodes. Will be testing this this week but would be great to hear your experiences. //TIA


Solution

  • You join your windows container hosts to swarm the same way you join UNIX ones (docker swarm join). You assign label to those nodes to identify that those are windows nodes and when you deploy service specify constraint for windows containers. It will work as you would expect with UNIX services. Current limitation is that you can only deploy in global mode, that is you have to have windows nodes running on each node since swarm mesh is not fully supported yet.

    https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/swarm-mode