I'm trying to make an Windows Nano Server container that runs an ASP.NET Core app.
I'm building it on Windows Server 2016. I can make it work, but there is one odd problem.
The only way I can make it work is to build the image, run the container, then start an interactive Powershell session and use
Invoke-WebRequest http://localhost:5000. Once I do that, the app is visible from other servers (I can't browse the container locally from the Win2016 Server due to a known NAT bug.)
Here's my Dockerfile:
FROM microsoft/dotnet:sdk-nanoserver ARG source WORKDIR /app COPY /ContainerPOC/ . RUN dotnet restore --runtime win10-x64 . RUN dotnet build --framework netcoreapp1.1 --runtime win10-x64 . EXPOSE 5000 ENV ASPNETCORE_URLS http://0.0.0.0:5000 CMD dotnet run --framework netcoreapp1.1
Any idea why this won't "just work?"