Docker Community Forums

Share and learn in the Docker community.

Could not connect to container from host machine

docker

(Raduflorescu) #1

Expected behavior

Being able to hit the container with a request coming from host machine

Actual behavior

I cannot seem to find a way to expose a port or to ping the container I just created.

Information

Windows 10 10.0.10586

  • the output of:
    • Moby Notification > Diagose & Feedback on Windows
  • a reproducible case if this is a bug, Dockerfiles FTW
  • page URL if this is a docs issue or the name of a man page
  • host distribution and version ( OSX 10.10.x, OSX 10.11.x, Windows, etc )

Steps to reproduce the behavior

  1. Using Docker for Windows Tools for Visual Studio
  2. Use this docker file on a blank project
  3. FROM microsoft/dotnet:1.0.0-core

FROM microsoft/dotnet:1.0.0-preview2-sdk

ENV NUGET_XMLDOC_MODE skip

Install debugging components

ARG CLRDBG_VERSION=VS2015U2
WORKDIR /clrdbg
RUN curl -SL https://raw.githubusercontent.com/Microsoft/MIEngine/getclrdbg-release/scripts/GetClrDbg.sh --output GetClrDbg.sh
&& chmod 700 GetClrDbg.sh
&& ./GetClrDbg.sh $CLRDBG_VERSION
&& rm GetClrDbg.sh

Set the Working Directory

WORKDIR /app

Configure the listening port to 80

ENV ASPNETCORE_URLS http://*:81
EXPOSE 81

Copy the app

COPY . /app

If we are launching through a remote debugger wait for it, otherwise start the app

ENTRYPOINT ["/bin/bash", “-c”, “if [ “$REMOTE_DEBUGGING” -eq 0 ]; then dotnet DockerDeployExample.dll; else sleep infinity; fi”]

  1. This container launches, but you cannot interact with it.

(Mario Pietsch) #2

Hi,
I found this page: https://visualstudiogallery.msdn.microsoft.com/0f5b2caa-ea00-41c8-b8a2-058c7da0b3e4 … They have a “Q & A” - tab, just right to the “Description” … IMO your question should be posted there?