title: Docker Desktop for Windows: cannot access service on exposed port in windows container mode
body: <p>I am using the following <strong>Dockerfiles</strong> to create a container running Jenkins in a windows container on Windows 10 desktop running <strong>Docker Desktop for Windows</strong> version 17.03</p>
  
  <pre><code>FROM microsoft/windowsservercore
  
  RUN powershell -Command wget 'http://javadl.oracle.com/webapps/download/AutoDL?BundleId=210185' -Outfile 'C:\jreinstaller.exe' ; Start-Process -filepath C:\jreinstaller.exe -passthru -wait -argumentlist "/s,INSTALLDIR=c:\Java\jre1.8.0_91" ; del C:\jreinstaller.exe
  
  ENV JAVA_HOME c:\\Java\\jre1.8.0_91  
  RUN setx PATH %PATH%;%JAVA_HOME%\bin
  
  CMD [ "java.exe" ]
  </code></pre>
  
  <p>I create the image from this docker file:</p>
  
  <pre><code>docker build -t windows-java:jre1.8.0_91 .
  </code></pre>
  
  <p>The second Dockerfile I am using to install Jenkins on top of this:</p>
  
  <pre><code>FROM windows-java:jre1.8.0_91
  
  ENV HOME /jenkins  
  ENV JENKINS_VERSION 2.58  
  RUN mkdir \jenkins  
  RUN powershell -Command "wget -Uri https://updates.jenkins-ci.org/latest/jenkins.war -UseBasicParsing -OutFile /jenkins/jenkins.war"
  
  EXPOSE 8080  
  EXPOSE 50000  
  
  CMD java -jar C:\\jenkins\\jenkins.war
  
  
  docker build -t jenkins-windows:2.0 .
  </code></pre>
  
  <p>Then I launch the container like this:</p>
  
  <pre><code>docker run --name jenkinsci -p 8080:8080 -p 50000:50000  jenkins-windows:2.0
  </code></pre>
  
  <p>I can see the container running fine and logs showing up all good</p>
  
  <pre><code>PS C:\Users\mandeep\ringba\ringba-jenkins-setup-windows\jenkins-master&gt; docker ps
  CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS                                              NAMES
  85ba2ef525a1        jenkins-windows:2.0   "cmd /S /C 'java -..."   8 hours ago         Up 8 hours          0.0.0.0:8080-&gt;8080/tcp, 0.0.0.0:50000-&gt;50000/tcp   jenkinsci
  </code></pre>
  
  <p>However, I cannot access the jenkins server running on <code>http://localhost:8080</code> on the host machine's web browser.</p>
  
  <p>Not sure if it helps but when I was running docker in <code>Linux container</code> mode on the same machine, I was able to access jenkins server on <code>http://localhost:8080</code> 
   using their official docker image. </p>