I am new to docker and windows container world. I am creating a sample application using ASP.NET Core 2.0 with SQL Server 2016 Backend. I am able to run the application successfully directly on Windows Server 2016 VM. Next I containerized it using Docker EE Windows Container. I started the container and able to browse the application from Windows Server 2016 VM host.
This is how I build and started the container, please assume I have created the .dockerfile with appropriate values.
docker build -t testapi .
docker run -d --name testapi_app --rm -it -p 8000:80 testapi
When I run
docker network ls
I get
NETWORK ID NAME DRIVER SCOPE
38c9f8e165bf nat nat local
f97c096a0ef6 none null local
When I run following command (02f4 is the container id first 4 characters)
docker exec 02f4 ipconfig
I can see the IPv4 address as 172.25.5.26
I am able to browse the application from host windows server 2016 VM using http://172.25.5.26/api/values
And I am getting the response back.
I will really appreciate if anyone can point me to some resources that can help me with how to make the application hosted with windows container using docker EE on a windows server 2016 VM host to be browsable from outside the host VM.
I feel like I may have to change some network options, but not exactly sure what is that I must change.
Any help will be greatly appreciated.