Docker Community Forums

Share and learn in the Docker community.

How to host multiple websites (with different IP’s) in IIS Container


(Balajepalli) #1

I am running docker on windows server 2016 and need to spin an IIS Container that can host multiple websites with different IP’s. How can i do that.


(Ntweekly) #2

Hi There,

You can create a Transparent network on your Docker Host and assign an IP address to your Container, read more below.

On IIS you would configure your sites as you would on a normal Windows Server.


(Balajepalli) #3

Thanks for your response, i created a transparent network and tried to run new containers using below command, but it binded only one IP (.3)

Command i am using
docker run -it --network=MyTransparentNet --ip=172.31.2.2 --ip=172.31.2.3 microsoft/nanoserver powershell

Please let me know.


(Ntweekly) #4

From the container add a secondary IP address using powershell with the cmdlets below:
Get-NetAdapter
New-NetIPAddress –InterfaceIndex 2 –IPAddress 192.168.0.26 -PrefixLength 24 -DefaultGateway 192.168.0.1

You can use the article below (works on Nano Server and Server core)