Sending build context to Docker daemon 1.368MB
Step 1/11 : FROM microsoft/aspnetcore-build as build-dev
---> 06a6525397c2
Step 2/11 : WORKDIR /code
---> Running in 4e9f0b7ebb6a
Removing intermediate container 4e9f0b7ebb6a
---> c0c554db9429
Step 3/11 : COPY *.csproj ./
---> 805ab0f9827c
Step 4/11 : RUN dotnet restore
---> Running in 91ed1afaf3f0
/usr/share/dotnet/sdk/2.1.202/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.TargetFrameworkInference.targets(135,5): error : The current .NET
SDK does not support targeting .NET Core 2.1. Either target .NET Core 2.0 or lower, or use a version of the .NET SDK that supports .NET Core 2.1. [/code/myapi.csproj]
The command '/bin/sh -c dotnet restore' returned a non-zero code: 1
将 microsoft/aspnetcore-build
改为 microsoft/dotnet:2.2-sdk
将 microsoft/aspnetcore-build 改为 microsoft/dotnet:2.2-sdk 是可以的
我看视频教程上console microsoft/dotnet:skd
api用microsoft/aspnetcore-build
怎么我的会出错呢 是因为 .net core的版本问题么?
@丿如何是好: 是 .net core sdk 版本的问题,microsoft/aspnetcore-build
是之前的镜像仓库,后来改为 microsoft/dotnet:x.x-sdk
@dudu: 好的 涨知识了 谢谢你