【发布时间】:2017-10-17 16:59:24
【问题描述】:
我正在尝试创建一个运行 ASP.NET Core 应用程序的 Windows Nano Server 容器。
我正在 Windows Server 2016 上构建它。我可以让它工作,但有一个奇怪的问题。
我可以让它工作的唯一方法是构建映像,运行容器,然后启动交互式 Powershell 会话并使用Invoke-WebRequest http://localhost:5000。一旦我从容器内部执行此操作,该应用程序就可以从其他服务器看到(由于已知的 NAT 错误,我无法从 Win2016 服务器本地浏览容器。)
这是我的 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
知道为什么这不能“正常工作”吗?
【问题讨论】:
标签: windows docker containers