在给eshopondapr 打镜像的时候碰到了3个错误

1、restore: Received an unexpected EOF or 0 bytes from the transport stream: https://github.com/NuGet/Home/issues/9020

2、Notice: NuGet Restore Failures on Linux distributions using NSS or ca-certificates #10712 :https://github.com/NuGet/Home/issues/10712

3、In .NET Core, libMan install 'Failed to download resource' #476:https://github.com/aspnet/LibraryManager/issues/476

解决方法:

1、.NET SDK 更新到5.0.202+升级 .NET 6 Preview 3+  : https://devblogs.microsoft.com/nuget/net-5-nuget-restore-failures-on-linux-distributions-using-nss-or-ca-certificates/

2、添加 --disable-parallel选项: RUN dotnet restore "eShopOnDapr.sln" --disable-parallel

3、运行命令 dotnet tool update --global Microsoft.Web.LibraryManager.Cli

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

ARG NET_IMAGE=5.0-focal

FROM mcr.microsoft.com/dotnet/aspnet:${NET_IMAGE} AS base

WORKDIR /app

EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:${NET_IMAGE} AS build

WORKDIR /src

# Create this "restore-solution" section by running ./Create-DockerfileSolutionRestore.ps1, to optimize build cache reuse

COPY ["src/ApiGateways/Aggregators/Web.Shopping.HttpAggregator/Web.Shopping.HttpAggregator.csproj", "src/ApiGateways/Aggregators/Web.Shopping.HttpAggregator/"]

COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"]

COPY ["src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj", "src/BuildingBlocks/EventBus/IntegrationEventLogEF/"]

COPY ["src/BuildingBlocks/WebHost/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHost/WebHost.Customization/"]

COPY ["src/Services/Basket/Basket.API/Basket.API.csproj", "src/Services/Basket/Basket.API/"]

COPY ["src/Services/Catalog/Catalog.API/Catalog.API.csproj", "src/Services/Catalog/Catalog.API/"]

COPY ["src/Services/Identity/Identity.API/Identity.API.csproj", "src/Services/Identity/Identity.API/"]

COPY ["src/Services/Ordering/Ordering.API/Ordering.API.csproj", "src/Services/Ordering/Ordering.API/"]

COPY ["src/Services/Payment/Payment.API/Payment.API.csproj", "src/Services/Payment/Payment.API/"]

COPY ["src/Web/WebSPA/WebSPA.csproj", "src/Web/WebSPA/"]

COPY ["src/Web/WebStatus/WebStatus.csproj", "src/Web/WebStatus/"]

COPY ["docker-compose.dcproj", "./"]

COPY ["NuGet.config", "./"]

COPY ["eShopOnDapr.sln", "./"]

RUN dotnet tool update --global Microsoft.Web.LibraryManager.Cli

RUN dotnet restore "eShopOnDapr.sln" --disable-parallel

COPY . .

WORKDIR "/src/src/Services/Identity/Identity.API"

# RUN dotnet build "Identity.API.csproj" -c Release -o /app/build

FROM build AS publish

RUN dotnet publish --no-restore "Identity.API.csproj" -c Release -o /app/publish

FROM base AS final

WORKDIR /app

COPY --from=publish /app/publish .

ENTRYPOINT ["dotnet", "Identity.API.dll"]

.NET 5.0 Docker 镜像 错误修复方法的更多相关文章

  1. 简单谈谈Docker镜像的使用方法_docker

    在上篇文章(在Docker中搭建Nginx服务器)中,我们已经介绍了如何快速地搭建一个实用的Nginx服务器.这次我们将围绕Docker镜像(Docker Image),介绍其使用方法.包括三部分: ...

  2. VNC错误修复⽅方法

    VNC错误修复方法 VNC错误描述 vnc viewer开启后弹窗提示 Could not connect to session bus: Failed to connect to socket /t ...

  3. VNC (vnc viewer)错误修复方法

    VNC错误描述 vnc viewer开启后弹窗提示 Could not connect to session bus: Failed to connect to socket /tmp/dbus-XX ...

  4. 优化 Docker 镜像大小常见方法

    平时我们构建的 Docker 镜像通常比较大,占用大量的磁盘空间,随着容器的大规模部署,同样也会浪费宝贵的带宽资源.本文将介绍几种常用的方法来优化 Docker 镜像大小,这里我们使用 Docker ...

  5. sqlserver数据库出现可疑错误修复方法

    一.主数据库出现可疑修复方法: 第一种方法: 当数据库发生这种操作故障时,可以按如下操作步骤可处理此要领,打开数据库里的Sql查询编辑器窗口,运行以下的命令: ?修改数据库为紧急模式 ALTER DA ...

  6. docker镜像的创建方法docker file方式

    什么是docker file文件? 简单来说,docker file文件就是一个命令文本集合,容来记录创建docker镜像的步骤 快速入门: 1.新建一个docker file文件dockerfile ...

  7. MySQL GTID 主从复制错误修复方法

    https://yq.aliyun.com/articles/155827?spm=5176.8067842.tagmain.6.RFPTAL MySQL 传统的主从复制方式使用 master_log ...

  8. docker镜像的创建方法docker commit方式

    Docker 提供了两种构建镜像的方法: docker commit 命令(交互式修改创建) Dockerfile 构建文件 (文本命令定义) Docker commit方法: 1.运行一个现有容器 ...

  9. JAVA SpringBoot 项目打包(JAR),在打包成 docker 镜像的基本方法

    1,打包 SpringBoot 项目,使用 IDEA 如下图 2,将 JAR 包上传到安装了 Docker 的 linux 服务器上,并且在相容目录下创建一个名为 Dockerfile 的文件 3,在 ...

随机推荐

  1. 【LeetCode】450. Delete Node in a BST 解题报告 (Python&C++)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 迭代 日期 题目地址:https://leetcode ...

  2. 1080 - Binary Simulation

    1080 - Binary Simulation    PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 64 ...

  3. 【Azure API 管理】为调用APIM的请求启用Trace -- 调试APIM Policy的利器

    问题描述 在APIM中,通过门户上的 Test 功能,可以非常容易的查看请求的Trace信息,帮助调试 API 对各种Policy,在Inbound,Backend, Outbound部分的耗时问题, ...

  4. OverFeat:Integrated Recognition, Localization and Detection using Convolutional Networks

    目录 概 主要内容 Sermanet P., Eigen D., Zhang X., Mathieu M., Fergus R., LeCun Y. OverFeat:integrated recog ...

  5. 更新系统为High sierra 后无法使用Cocoapods

    sudo gem update --system sudo gem install -n /usr/local/bin cocoapods执行完就可以直接用了.

  6. vmware虚拟IOS系统

    安装虚拟机     --以管理员的身份运行

  7. 排列组合 "n个球放入m个盒子m"问题 总结

    求,盒子都可以分成是否不能区分,和能区分,还能分成是否能有空箱子,所以一共是8种情况,我们现在来一一讨论. 1.球同,盒不同,无空箱 C(n-1,m-1), n>=m0, n<m 使用插板 ...

  8. Zookeeper基础教程(一):认识Zookeeper

    引用百度百科的话 ZooKeeper是一个分布式的,开放源码的分布式应用程序协调服务,是Google的Chubby一个开源的实现,是Hadoop和Hbase的重要组件.它是一个为分布式应用提供一致性服 ...

  9. CSS基础 盒子相关属性总结 padding+border

    1.border当个属性: 作用 属性名 属性值 边框粗细 border-width 数字+px 边框样式 border-style solid实线.dashed虚线.dotted点线 边框颜色 bo ...

  10. 04.python哈希表

    python哈希表 集合Set 集合,简称集.由任意个元素构成的集体.高级语言都实现了这个非常重要的数据结构类型. Python中,它是可变的.无序的.不重复的元素的集合. 初始化 set() -&g ...