首页 新闻 会员 周边 捐助

dockerfile RUN dotnet restore 报错

0
悬赏园豆:10 [已解决问题] 解决于 2019-03-17 16:38

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

丿如何是好的主页 丿如何是好 | 菜鸟二级 | 园豆:213
提问于:2019-03-17 16:17
< >
分享
最佳答案
0

microsoft/aspnetcore-build 改为 microsoft/dotnet:2.2-sdk

收获园豆:10
dudu | 高人七级 |园豆:30585 | 2019-03-17 16:23

将 microsoft/aspnetcore-build 改为 microsoft/dotnet:2.2-sdk 是可以的
我看视频教程上console microsoft/dotnet:skd
api用microsoft/aspnetcore-build
怎么我的会出错呢 是因为 .net core的版本问题么?

丿如何是好 | 园豆:213 (菜鸟二级) | 2019-03-17 16:33

@丿如何是好: 是 .net core sdk 版本的问题,microsoft/aspnetcore-build 是之前的镜像仓库,后来改为 microsoft/dotnet:x.x-sdk

dudu | 园豆:30585 (高人七级) | 2019-03-17 16:37

@dudu: 好的 涨知识了 谢谢你

丿如何是好 | 园豆:213 (菜鸟二级) | 2019-03-17 16:38
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册