【发布时间】:2018-02-28 12:34:35
【问题描述】:
这是我的 Dockerfile:
FROM microsoft/aspnetcore-build:1.0 AS build-env
WORKDIR /app
# copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore
# copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out
# build runtime image
FROM microsoft/aspnetcore:1.0
WORKDIR /app
COPY --from=build-env /app/out .
EXPOSE 58912
ENTRYPOINT ["dotnet", "SgaApi.dll"]
我使用这个命令构建:docker build -f Dockerfile -t sga .
运行:docker run -e "ASPNETCORE_URLS=http://+:58912" -it --rm sga
Application starts successfully
我无法从浏览器访问它。当我使用“dotnet run”运行应用程序时,它工作正常。
【问题讨论】:
标签: docker asp.net-web-api dockerfile asp.net-core-1.1