Docker – “It was not possible to find any compatible framework version” with ASP.NET Core 2.1 in Docker

.net coreasp.net-coreasp.net-core-2.1docker

I'm trying to update an ASP.NET Core 2.0 application that runs in Docker to .NET Core 2.1 RC1.

Here's my simplified .csproj file:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <Version>$(Version)</Version>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0-rc1-final" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.1.0-preview1-final" />
  </ItemGroup>
</Project>

And here's the Dockerfile:

FROM microsoft/dotnet:2.1-sdk-alpine AS builder
WORKDIR /
COPY . .
RUN dotnet restore My.Project/My.Project.csproj
RUN dotnet publish My.Project/My.Project.csproj -o /dockerout/ -c Release

FROM microsoft/dotnet:2.1-aspnetcore-runtime-alpine
WORKDIR /app
EXPOSE 80 5000

COPY --from=builder /dockerout .

ENTRYPOINT ["dotnet", "My.Project.dll"]

I can build the image in Docker but running it fails with

It was not possible to find any compatible framework version The specified framework 'Microsoft.AspNetCore.All', version '2.1.0-rc1-final' was not found.

Is there something I'm missing? Or should I just wait for the final release of Core 2.1?

Best Answer

I created https://github.com/dotnet/dotnet-docker/issues/529 and after checking again, it suddently started to work. No idea, what happened.