ASP.NET Core 2 — Docker — Falha na extração após “pull” request — ProcessUtilityVMImage — UtilityVM

  • Windows Server 2016 1607
  • Windows Server 2016 1790
  • Windows Server Core 2016 1790
  • Windows Server 2016 1803
  • Windows Server Core 2016 1803

Windows Server 2016 1607

Imagens para ASP.NET Core 2.1

  • Windows Server 2016 1607 instalado;
  • Docker build gerada com a imagem base.
  • 2.1-sdk
  • 2.1-aspnetcore-runtime
  • 2.1-runtime

Solução — Windows Server 2016

  • Instale o Windows Server 2016 (build 1709 ou superior), ambas já possuem suporte aos containers. Você vai também encontrar com os nomes “Microsoft Windows Server 1709 with Containers — ami-cb271cae” ou “Microsoft Windows Server 1709 Semi-Annual Channel release with Containers [English]”

Solução — Dockerfile

FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base  
WORKDIR /app
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY *.csproj <projectname>/
RUN dotnet restore <projectname>/<project>.csproj
WORKDIR /src/<projectname>
COPY . ./
RUN dotnet build <project>.csproj -c Release -o /app
FROM build AS publish
RUN dotnet publish <project>.csproj -c Release -o /app
ENV ASPNETCORE_ENVIRONMENT DevelopmentFROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "<projectname>.dll"]

Dica

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alex Tochetto

Alex Tochetto

More from Medium

How to Deploy .NET

Kong API Gateway — Docker Container

Rate Limiting using Kong API Gateway

Pass Through Data Over IServiceProvider.CreateScope()