.NET 5.0 Docker 镜像 错误修复方法
在给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 镜像 错误修复方法的更多相关文章
- 简单谈谈Docker镜像的使用方法_docker
在上篇文章(在Docker中搭建Nginx服务器)中,我们已经介绍了如何快速地搭建一个实用的Nginx服务器.这次我们将围绕Docker镜像(Docker Image),介绍其使用方法.包括三部分: ...
- VNC错误修复⽅方法
VNC错误修复方法 VNC错误描述 vnc viewer开启后弹窗提示 Could not connect to session bus: Failed to connect to socket /t ...
- VNC (vnc viewer)错误修复方法
VNC错误描述 vnc viewer开启后弹窗提示 Could not connect to session bus: Failed to connect to socket /tmp/dbus-XX ...
- 优化 Docker 镜像大小常见方法
平时我们构建的 Docker 镜像通常比较大,占用大量的磁盘空间,随着容器的大规模部署,同样也会浪费宝贵的带宽资源.本文将介绍几种常用的方法来优化 Docker 镜像大小,这里我们使用 Docker ...
- sqlserver数据库出现可疑错误修复方法
一.主数据库出现可疑修复方法: 第一种方法: 当数据库发生这种操作故障时,可以按如下操作步骤可处理此要领,打开数据库里的Sql查询编辑器窗口,运行以下的命令: ?修改数据库为紧急模式 ALTER DA ...
- docker镜像的创建方法docker file方式
什么是docker file文件? 简单来说,docker file文件就是一个命令文本集合,容来记录创建docker镜像的步骤 快速入门: 1.新建一个docker file文件dockerfile ...
- MySQL GTID 主从复制错误修复方法
https://yq.aliyun.com/articles/155827?spm=5176.8067842.tagmain.6.RFPTAL MySQL 传统的主从复制方式使用 master_log ...
- docker镜像的创建方法docker commit方式
Docker 提供了两种构建镜像的方法: docker commit 命令(交互式修改创建) Dockerfile 构建文件 (文本命令定义) Docker commit方法: 1.运行一个现有容器 ...
- JAVA SpringBoot 项目打包(JAR),在打包成 docker 镜像的基本方法
1,打包 SpringBoot 项目,使用 IDEA 如下图 2,将 JAR 包上传到安装了 Docker 的 linux 服务器上,并且在相容目录下创建一个名为 Dockerfile 的文件 3,在 ...
随机推荐
- B. Arpa's weak amphitheater and Mehrdad's valuable Hoses
B. Arpa's weak amphitheater and Mehrdad's valuable Hoses time limit per test 1 second memory limit p ...
- IDEA 延长使用
压缩包下载地址:https://i.cnblogs.com/files 1.先以试用的形式进入idea,然后help -> Edit Custom VM Options 2.插入 :-javaa ...
- 【环境搭建】安装pyQt5 在pycharm报This application failed to start because no Qt platform plugin could be initialized的问题
报错:This application failed to start because no Qt platform plugin could be initialized 解决办法: http:// ...
- Spring Boot实战三:集成RabbitMQ,实现消息确认
Spring Boot集成RabbitMQ相比于Spring集成RabbitMQ简单很多,有兴趣了解Spring集成RabbitMQ的同学可以看我之前的<RabbitMQ学习笔记>系列的博 ...
- 详解Kalman Filter
中心思想 现有: 已知上一刻状态,预测下一刻状态的方法,能得到一个"预测值".(当然这个估计值是有误差的) 某种测量方法,可以测量出系统状态的"测量值".(当然 ...
- Android物联网应用程序开发(智慧城市)—— 查询购物信息界面开发
效果: 布局代码: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xm ...
- MongoDB 变更流(Change Stream)介绍
1. 什么是Change Stream Change Stream 是MongoDB用于实现变更追踪的解决方案,类似于关系数据库的触发器,但原理不完全相同: | | Change Stream | 触 ...
- hexo 升级5.4.0出现错误解决方法-hexo-theme-butterfly
本篇文章已同步个人博客,可移步食用.hexo 升级 5.4.0 出现错误解决方法 -hexo-theme-butterfly 周末升级了下 hexo 到新版本,发现升级后,构建时出现了一些错误,以下是 ...
- pycharm debug调试模式报“UnicodeDecodeError:'gdk' codec can't decode byte 0xac”,无法正常调试
遇到的问题: 本机python 3.8 pycharn 3.4.4 运行代码的时候,选择debug模式,提示"UnicodeDecodeError:'gdk' codec can't dec ...
- Linux中安装java JDK
Linux中安装java JDK 1.下载jdk 下载地址:https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads. ...