Docker Community Forums

Share and learn in the Docker community.

Docker Swarm with Static Ports


(Andrewsheley) #1

OS: Windows Server 2016 (gui version)
OS Build: Microsoft Windows [Version 10.0.14393]
Docker Version: 17.06.2-ee-6
Docker API Version: 1.30

I have successfully created a swarm service on Windows server 2016 and it works great except I can’t run the router mesh service; I have to run with “mode=host” which publishes the exposed ports to the host. I know this is resolved if you switch to Windows server 2016 build 1709.

However, is there an ability to assign static ports to the replicas so that when the server reboots or I scale the service up or down it doesn’t change the ports assigned to the service. With the ports changing it creates problems to reverse proxy IIS to it since if the server reboots all the ports change when the service is started up. If I could somehow assign static non-changing ports to my service replicas that would eliminate this problem. Any help or ideas are appreciated. I know changing to Windows server 2016 - 1709 would be the simple solution but I was wondering how to fix it for the regular Server 2016 version. Thanks for your time.

Andy Sheley