1

I wan,t create simple asp.net core application and deploy it to windows server 2016 docker container.

This is My server OS and I pulled latest nanoserver base image

enter image description here

And when I trying to pull app it gives me error?: enter image description here

enter image description here

I read about os compability but not understand what is wrong.

The default asp.net core application docker file looks like

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

How I must change it for my virtual server?

Kamil Ibadov
  • 1,436
  • 2
  • 20
  • 44

1 Answers1

0

I solved problem changing version, final version of docker look like

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"]
Kamil Ibadov
  • 1,436
  • 2
  • 20
  • 44