Search code examples
c#.netdockerwindows-server-2016

no matching manifest for windows/amd64 Server 2016


Created a simple .net core app. Trying to run docker build but I'm getting:

"no matching manifest for windows/amd64 10.0.14393 in the manifest list entries"

Docker File:

FROM microsoft/dotnet:sdk AS build-env
WORKDIR /app

# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore

# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out

# Build runtime image
FROM microsoft/dotnet:aspnetcore-runtime
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "HelloWorld.dll"]

Take 2: Tried vs2019, created new MVC app => add docker support (windows) Dockerfile:

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

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

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

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

Now getting:

a Windows version 10.0.17763-based image is incompatible with a 10.0.14393 host

enter image description here

Docker that's installed on the Server:

Name Version ---- ------- Docker 19.03.2

Why can't I run these on Windows Server 2016?. It worked fine on Windows 10 locally


Solution

  • For Windows images, the Windows version of your Docker host matters when determining which image tag you should be using.

    For the first error: no matching manifest for windows/amd64 10.0.14393 in the manifest list entries, this error occurs when using a multi-arch tag for which there is no concrete tag that matches the OS version/architecture of your Docker host. I'm not sure exactly which tag caused the error but I'm guessing it was microsoft/dotnet:aspnetcore-runtime. This is a multi-arch tag and Docker will look at your host information to resolve that tag to a OS version/architecture-specific concrete tag. In this case, there was no tag available for your host version 10.0.14393.

    For the second error: a Windows version 10.0.17763-based image is incompatible with a 10.0.14393 host, in this case you're using a tag that is Windows version-specific so there's no resolving necessary here; you're explicitly stating which Windows version of the image you want. The problem is that you're trying to use a higher version of Windows than what your Docker host is using. That can't be done; you can only use the same version or lower (and you can only use lower versions based on certain conditions: https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility).

    There are not any supported .NET Core images available for Windows Server 2016. See here for the current tag list: https://hub.docker.com/_/microsoft-dotnet-core-sdk. If you're able to make use of a Windows Server version 1803 or later, you should be good.