Dotnet Core Aspnet 1.1的简单(st)Dockerfile

时间:2016-12-28 22:34:14

标签: asp.net-core .net-core dockerfile

为什么下面的OSX中的Dockerfile卡在dotnet restore上并且没有进入dotnet run? (当我手动执行命令时它起作用)

Step 8 : RUN dotnet restore
 ---> Running in 3ef8b4c1d107

Dockerfile:

FROM microsoft/dotnet
VOLUME /Documents/Docker/dnc
EXPOSE 80
ENV "ASPNETCORE_URLS=http://+:80"
RUN mkdir app
RUN cd app
RUN dotnet new -t web
RUN dotnet restore
RUN dotnet run

1 个答案:

答案 0 :(得分:0)

another SO post的帮助下,我发现我错过了WORKDIR 正确的代码是:

FROM microsoft/dotnet
VOLUME /Documents/Docker/dnc
EXPOSE 80
ENV "ASPNETCORE_URLS=http://+:80"
RUN mkdir app
# RUN cd app <- turned out was not necessary.
WORKDIR /app
RUN dotnet new -t web
RUN dotnet restore
RUN dotnet run