Updated 08. Setting up and Deploying eShopOnContainers to Windows Containers (markdown)

Cesar De la Torre 2018-01-07 10:25:28 -08:00
parent 3abc851e35
commit a08e7430a3

@ -25,11 +25,13 @@ Then right click in the Docker icon on the notification bar and select the optio
## The localhost loopback limitation ## The localhost loopback limitation
Due to a default NAT limitation in Windows (see [https://blog.sixeyed.com/published-ports-on-windows-containers-dont-do-loopback/](https://blog.sixeyed.com/published-ports-on-windows-containers-dont-do-loopback/)) you can't access your containers using `localhost` from the host computer. Due to a default NAT limitation in current versions of Windows (see [https://blog.sixeyed.com/published-ports-on-windows-containers-dont-do-loopback/](https://blog.sixeyed.com/published-ports-on-windows-containers-dont-do-loopback/)) you can't access your containers using `localhost` from the host computer.
Instead of localhost you can use either an IP address from the network card of the host or you can also use the DockerNAT IP address, that is `10.0.75.1`. If you don't have that IP when you show info with `ipconfig`, you'll need to switch to Linux Containers so it creates that Docker NAT and then go back to Windows Containers (right click on Docker icon on the task bar). Although that limitation has been removed beginning with Build 17025 (still only available today to Windows Insiders, not public/stable release). With that version, access to published container ports via “localhost”/127.0.0.1 is available.
If you use `start-windows-containers.ps1` to start the containers, that script will create environment variables with that IP for you, but if you directly use docker-compose, then you have to set the following environment variables: Until you can use newer build of Windows 10 or Windows Server 2016, instead of localhost you can use either an IP address from the host's network card of (for example, let's suppose you have the 192.168.0.1 address) or you could also use the DockerNAT IP address, that is `10.0.75.1`. If you don't have that IP (`10.0.75.1`) shown when you get the info with `ipconfig`, you'll need to switch to Linux Containers so it creates that Docker NAT and then go back to Windows Containers (right click on Docker icon on the task bar).
If you use `start-windows-containers.ps1` to start the containers, as explained in the following section, that script will create environment variables with that IP for you, but if you directly use docker-compose, then you have to set the following environment variables:
Where you see `10.75.0.1` you could also use your network card IP discovered with `ipconfig`, or a production DNS name or IP if this were a production deployment. Where you see `10.75.0.1` you could also use your network card IP discovered with `ipconfig`, or a production DNS name or IP if this were a production deployment.