6
votes

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?

1
can you run dotnet version inside your docker container, to see what exact version you have available there?Riscie
@Riscie in the first phase it prints 2.1.300-rc1-008673. In the second phase it prints an error "Did you mean to run dotnet SDK commands? Please install dotnet SDK from: go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409".Kirill Rakhman

1 Answers

-3
votes

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