在给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. .Net Core&Agile Config配置中心

    当服务逐渐的增多,对各服务的配置管理愈加重要,轻量级的配置中心,入手或是搭建都简单许多,基于.net core开发的轻量级配置中心AgileConfig,功能强大,上手简单. https://gith ...

  2. Chapter 15 Outcome Regression and Propensity Scores

    目录 15.1 Outcome regression 15.2 Propensity scores 15.3 Propensity stratification and standardization ...

  3. Java程序设计基础笔记 • 【第7章 Java中的类和对象】

    全部章节   >>>> 本章目录 7.1 理解类和对象 7.1.1 对象 7.1.2 抽象与类 7.1.3 类与对象的关系: 7.2 Java中的类和对象 7.2.1 类的定义 ...

  4. 「艺蜂酒店管理系统」 · Java Swing + mysql 开发 学生毕业设计项目

    Java  Swing在社会上基本用不到,但是任有学校拿来当做结课设计,只是博主在校期间的一个项目.如果在部署过程中有问题可以加我qq68872185. 码云仓库地址:https://gitee.co ...

  5. contos mongodb 安装

    创建.repo文件,生成mongodb的源 vi /etc/yum.repos.d/mongodb-org-4.0.repo [mongodb-org-4.0] name=MongoDB Reposi ...

  6. Swoole 协程使用示例及协程优先级

    示例一: Co::set(['hook_flags'=> SWOOLE_HOOK_ALL]); Co\run(function () { go(function() { var_dump(fil ...

  7. Springboot项目引入druid安装部署使用

    一.maven引入依赖,数据库驱动根据项目需求自行引入 <!-- https://mvnrepository.com/artifact/com.alibaba/druid-spring-boot ...

  8. c# - 关于位移符号 >> 和 << 的使用

    1.前言 这是对二进制数据进行位移的方法 2.操作 using System; namespace ConsoleApp1.toValue { public class test1 { public ...

  9. Centos7 文件权限理解(持续更新)

    后期排版,边学边记边敲 用户详情分析 管理员用户 root  0 虚拟用户 nobody  1-999 普通用户 test001  1000+ 输入ll命令查看当前目录文件详情 根据这张图片可知,目录 ...

  10. 打开Cmd的方式与基础Dos命令

    基础的Dos命令 打开Cmd的方式 开始->Windows系统->命令提示符 Win键 + R输入cmd打开控制台 在任意的文件夹下面,按住shift键+鼠标右键点击在此处打开powers ...