New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker port binding not working as per documentation (iisdemo) #181
Comments
Stefan Scherer from the Docker team was able to reproduce the issue on Windows Server 2016 TP4. |
@mathiasconradt Thank you for the compliment, but I'm not from the Docker team |
Issues with New-ContainerHost and Nano
I verify @StefanScherer 's latest https://github.com/StefanScherer/docker-windows-box Windows 2016 TP5 still have this issue (VirtualBox + fresh box install). |
I checked with the devs and they're aware of the issue. It will be fixed before Windows Server 2016 is shipped, but unfortunately I don't have a workaround for TP5. |
Thanks for an update! |
Can this be the reason localhost port binding doesn't work on Windows 10, too? What does work however is: |
Is there any news on this? I have the same issue on Windows 10 with latest Docker 1.13 beta... |
Pinging @JMesser81 |
It is well documented that container endpoints attached to a Windows NAT network cannot be accessed using the external (host) IP and port. Instead, if you're trying to access a container endpoint from the container host itself, you must use the internal (NAT) IP and port. This limitation is being fixed in the next release of Windows. |
@JMesser81 what next release? Server? Win10? |
@JMesser81 you write "cannot be accessed using external IP and port" but I can't use "localhost" or 127.0.0.1 to access local containers, is that the same issue? |
Looking for more documentation Windows 10 container endpoints attached to the host issue on what is normal and/if there is a game plan on what is going to be fixed. Just started with docker engine for windows but this is honestly a surprise and this thread is what comes up on google about this issue. |
@pbering - not sure I understand. Are you trying to access a container endpoint from the host using 127.0.0.1 or loopback? Or, are you trying to access the host from a container using 127.0.0.1 or loopback? |
@JohnPAguirre - Here's a blog article I wrote about WinNAT capabilities and limitations. Most of the limitations I mention will be fixed in the next release. @rs38 - Server and client are now merged so they're essentially one and the same release. Hoping to see some improvements in Windows Insider Preview (WIP) builds and possibly Windows Server previews (TBD) sometime in the new year. |
@JMesser81 I'm trying to access a container endpoint from the host with localhost:8000. |
@JMesser81 could you also throw the link to the blog post about "WinNAT capabilities and limitations. " that you mentioned? |
Accessing a container endpoint from the host using localhost is not supported. You must use the internal IP address/port of the container endpoint. |
Related issue requesting a timeline for this fix: microsoft/aspnet-docker#13 |
Hey Jason, any update on this one? |
I would also like to know some ETA for this. It's been over a year now and this is still not done. In developer's point of view this is one of the most critical things but it seems that all the "sexier" stuff gets done. |
@kallie-b - who can provide an update. Soon :-) |
@JMesser81 @kallie-b can you at least reveal if it will be for Windows Insiders first or for all? Insiders means it will be again months after users restricted by corporate policies are able to use it. |
@JanneRantala -- Localhost/loopback support is part of the work we're doing for our next Windows release. We just completed a release, and currently Windows is on a semi-annual release cadence. That puts the next full Windows release in the Spring. But, as you mentioned, before then you'll have access to our newest features via the Windows Insiders program. I'll reply back to this thread when localhost/loopback support for containers is available to Windows Insiders, which should be very soon :) Of course, as is mentioned above, while you're waiting for localhost/loopback support, you can access your containers via published port on their host using either:
|
Hi @kallie-b any news on windows Localhost/loopback support ? |
It‘s available in Windows Insider 17035 or above. So it should be part of 1803 / RS4 release. |
@StefanScherer I'm running Windows 10 Build 1803, but still have the same problem. Can you confirm if this fix made it into 1803, or do I still need to use Windows Insider builds? |
I tested the fix sucessfully two weeks ago with 1803. Visual Studio "deploy to docker" still does the "old" way with grabbing the "172.x.x.x." from the container config. |
Strange. I'm running the container like so:
I can reach the site on the IP of the container on port 80, but I cannot reach the site on localhost:567 or 127.0.0.1:567. I'm using pure Docker commands and not Visual Studio for anything. I'm on Windows 10 Build 1803, and am NOT on Windows Insider. |
@MikeChristensen the container image must also be newer than the ltsc image. I've checked in Windows 10 1803, Docker for Windows Stable 18.03.1-ce-win65 and this example image:
|
@daschott :) |
Ah, so this is only supported on Windows 10 images. I was using
Any idea when the Windows Server Core images will support this? Thanks! |
there are no "Windows 10 images"... docker images can base on the latest semi annual "kernel" which can be servercore or nano. try: By the way I do not really understand why the regarding virtual NIC / Switch and NAT Problem resulting in not binding to localhost needs Container Host and Base Image 1803 when working in Hyper-V abstraction like mandatory for Win10. |
@rs38 @MikeChristensen @StefanScherer I confirm that localhost/loopback support on Windows 10 April 2018 and Windows Server 1803 is a known issue that is actively being fixed. Even though the functionality may work for some people, it will not work for everyone. Using a new container image is also not going to fix it unfortunately! I will post back here once a fix is out :) |
As a (perhaps not very ideal) workaround in the meantime: Otherwise, you should be also able to access the exposed service using http://hostname:hostport |
Odd. I don't have any 169.x.x.x addresses, yet localhost doesn't work (on Windows 10 host and aspnet:4.7.1-windowsservercore-1709 image). My IPs on the host are:
|
I'm seeing same kind of problems with following setup on Windows Server build 17650 running on bare metal: IPv4 Address. . . . . . . . . . . : 192.168.2.188 I cannot reach port from localhost, container IP nor the 192.168 address from host. I can reach the port from another computer on network (goes to 192.168 IP). |
I am still a bit confused because I thought I already had that running and tested an app bound at locahost. Currently I can reach the container (either 1709 or 1803 nano based, they behave the same) locally on my static IP, which is okay:
Win10 1803 |
@MikeChristensen @rs38 @StefanScherer From Windows Insider build 17692 and above, you should be able to access this using: We are still working on all the checkmarks that are needed to be able to propagate this fix to Windows April 2018 Update and Windows Server, version 1803. I will post back here if a KB is released. |
Hi, @MikeChristensen @rs38 @StefanScherer. We backported the container localhost/loopback access fix for Windows April 2018 Update (Windows 10 version 1803) through KB4340917, available now. To validate this fix, you can use |
Confirmed this works on Windows 10 with latest updates. Thanks!! |
@daschott has the fix been ported to Windows Server, version 1803 |
@adragoset This should work for you on 1803 with the KB4340917 now :) |
Fixed in 1803. See KB4340917 |
The iisdemo / port binding described on https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/manage_docker#create-iis-image-1- does not work in the way described there.
It's either not clear what the host is (from my understanding, it should be the actual Windows 2016 server that I run docker on, so it should be "localhost" relative from there) or the port binding isn't working.
docker run --name iisdemo -it -p 8800:80 windowsservercoreiis cmd
does not bind the port 8800 on the host. I should be able to open "localhost:8800" or "172.16.0.1:8800" on the host (172.16.0.1 being the IP of the host, while 172.16.0.2 being the IP of the container).
Neither works a:
docker run --name iisdemo -it -p 80:80 windowsservercoreiis cmd
(Firewall rules are added, but also Windows Firewall entirely disabled just to be sure).
What's also interesting is that when I block port 80 on the host with some other service, and then start the docker container with port binding 80:80, I don't get any conflict, which I would expect though.
I can reach the IIS via the container IP, but I cannot reach it via host IP and bound port.
Original, fully detailed problem description here:
http://superuser.com/questions/1057223/windows-container-port-binding-on-windows-server-2016-not-working
Update:
In a second attempt, I used powershell instead of Docker to manage the container. I followed the documentation step by step on https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/manage_powershell#create-iis-container-1-, but also with no luck. I cannot reach the IIS via the host IP and bound port, only via the container IP.
The text was updated successfully, but these errors were encountered: