I am trying to run a app build on dotnet Core 3.0, packed in a docker image, on a production server running OS w2016.
When I run the docker image at the server I got this incompatible image error:
a Windows version 10.0.17763-based image is incompatible with a 10.0.14393 host
As I understand, I need to build the image using a base image compatible with the target host. So, I need to look for 1607 base images . The problem is, I can't find an image for dotnet Core 3.0 targeting that server version.
W2016 is recent, docker should allow to run in every server, so what i am missing here?
For clarity, here the dockerfile i am trying to write:
#this image not exists for os version 1607
FROM mcr.microsoft.com/dotnet/core/runtime:3.0-nanoserver-1607 AS base
WORKDIR /app
#this image not exists for os version 1607
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-nanoserver-1607 AS build
WORKDIR /src
COPY ["ConsoleApp7/ConsoleApp7.csproj", "ConsoleApp7/"]
RUN dotnet restore "ConsoleApp7/ConsoleApp7.csproj"
COPY . .
WORKDIR "/src/ConsoleApp7"
RUN dotnet build "ConsoleApp7.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "ConsoleApp7.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ConsoleApp7.dll"]
Update:
This is my first docker project, so i probably lack some knowledge. According to this post dotnet core image is not supported on w2016.
But should i be able to run using hiper-v isolation? Following this official post, i try to run
I try this command:
docker run -it --isolation=hyperv mcr.microsoft.com/windows/servercore:ltsc2019 cmd
but it fails with the following error because still wants a compatible image:
no matching manifest for windows/amd64 10.0.14393 in the manifest list entries.
Update2:
For clarity, the error:
a Windows version 10.0.17763-based image is incompatible with a 10.0.14393 host
was throw when running an image based on mcr.microsoft.com/dotnet/core/runtime:3.0-nanoserver-1903 for my pathfinder app.
The problem is how to pack the app and run on a windows 2016 server