重新执行错误:退出状态1:输出:ProcessUtilityVMImage \ UtilityVM:系统找不到指定的路径

时间:2019-04-02 16:11:45

标签: .net docker asp.net-core devops nano-server

我想创建一个简单的asp.net核心应用程序并将其部署到Windows Server 2016 Docker容器中。

这是我的服务器操作系统,我提取了最新的nanoserver基本映像

enter image description here

当我尝试拉应用程序时,它给我错误吗?: enter image description here

enter image description here

我读到了os compability的内容,但不明白怎么了。

默认的asp.net核心应用程序docker文件如下

FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-1803 AS base
WORKDIR /app
EXPOSE 80

FROM microsoft/dotnet:2.1-sdk-nanoserver-1803 AS build

我必须如何为我的虚拟服务器更改它?

1 个答案:

答案 0 :(得分:0)

我解决了更改版本的问题,码头工人的最终版本看起来像

FROM mcr.microsoft.com/dotnet/core/aspnet:2.1-nanoserver-sac2016 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/core/sdk:2.1-nanoserver-sac2016 AS build
WORKDIR /src
COPY ["App8/App8.csproj", "App8/"]
RUN dotnet restore "App8/App8.csproj"
COPY . .
WORKDIR "/src/App8"
RUN dotnet build "App8.csproj" -c Release -o /app

FROM build AS publish
RUN dotnet publish "App8.csproj" -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "App8.dll"]