publish a web api based on asp.net core RC2 on docker
I’m trying to publish a web api on docker based on docker.
I’m using a docker file with the following content :
COPY . /dotnetapp
RUN dotnet restore
ENTRYPOINT dotnet run
I can build and run the image but i’m not able to acces to web api.
One Solution collect form web for “publish a web api based on asp.net core RC2 on docker”
Seems like you have to specify which URL Kestrel will listen to otherwise it won’t accept any connection outside same container.
So your ENTRYPOINT should be something like
ENTRYPOINT ["dotnet", "run", "--server.urls=http://0.0.0.0:5000"]
Including the –server.urls argument is vital to allow inbound connections from outside container. If not, Kestrel will reject any connection that is not coming from the container, something not really useful…