在docker桌面上发布太慢



我是。net核心开发人员,我正试图在docker上发布但每次我在docker桌面或服务器上发布我的项目时,都需要很长时间每次它从https://api.nuget.org/v3-flatcontainer

下载所有的nuget是否有办法不每次下载或本地下载

我的dockerfile之一是:

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["Services/Localization/Localization.API/Localization.API.csproj", "Services/Localization/Localization.API/"]
RUN dotnet restore "Services/Localization/Localization.API/Localization.API.csproj"
COPY . .
WORKDIR "/src/Services/Localization/Localization.API"
RUN dotnet build "Localization.API.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Localization.API.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Localization.API.dll"]

我的输出是:

Determining projects to restore...
#20 10.86   Skipping project "/src/BuildingBlocks/Core/Core.Common/Core.Common.csproj" because it was not found.
#20 10.89   Skipping project "/src/BuildingBlocks/Core/Core.Common/Core.Common.csproj" because it was not found.
#20 80.99   Failed to download package 'Microsoft.Extensions.Configuration.Json.5.0.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.configuration.json/5.0.0/microsoft.extensions.configuration.json.5.0.0.nupkg'.
#20 80.99   The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.configuration.json/5.0.0/microsoft.extensions.configuration.json.5.0.0.nupkg' timed out because no data was received for 60000ms.
#20 80.99     Exception of type 'System.TimeoutException' was thrown.
#20 81.40   Failed to download package 'Microsoft.Extensions.Configuration.5.0.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.configuration/5.0.0/microsoft.extensions.configuration.5.0.0.nupkg'.
#20 81.40   The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.configuration/5.0.0/microsoft.extensions.configuration.5.0.0.nupkg' timed out because no data was received for 60000ms.
#20 81.40     Exception of type 'System.TimeoutException' was thrown.
#20 82.15   Failed to download package 'MediatR.9.0.0' from 'https://api.nuget.org/v3-flatcontainer/mediatr/9.0.0/mediatr.9.0.0.nupkg'.
#20 82.15   The download of 'https://api.nuget.org/v3-flatcontainer/mediatr/9.0.0/mediatr.9.0.0.nupkg' timed out because no data was received for 60000ms.
#20 82.15     Exception of type 'System.TimeoutException' was thrown.
#20 90.91   Failed to download package 'Autofac.6.1.0' from 'https://api.nuget.org/v3-flatcontainer/autofac/6.1.0/autofac.6.1.0.nupkg'.
#20 90.91   The download of 'https://api.nuget.org/v3-flatcontainer/autofac/6.1.0/autofac.6.1.0.nupkg' timed out because no data was received for 60000ms.
#20 90.91     Exception of type 'System.TimeoutException' was thrown.
#20 94.41   Restored /src/Services/WebSite/WebSite.Infrastructure/WebSite.Infrastructure.csproj (in 1.33 min).
#20 94.67   Restored /src/Services/WebSite/WebSite.Domain/WebSite.Domain.csproj (in 171 ms).
#20 99.41   Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.options.configurationextensions/index.json'.
#20 99.41   Resource temporarily unavailable (api.nuget.org:443)
#20 99.41     Resource temporarily unavailable
#20 105.2   Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.options.configurationextensions/index.json'.
#20 105.3   Resource temporarily unavailable (api.nuget.org:443)
#20 105.3     Resource temporarily unavailable
#20 109.2   Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/swashbuckle.aspnetcore.swaggerui/index.json'.
#20 109.2   Resource temporarily unavailable (api.nuget.org:443)
#20 109.2     Resource temporarily unavailable
#20 109.2   Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/swashbuckle.aspnetcore.swaggergen/index.json'.
#20 109.2   Resource temporarily unavailable (api.nuget.org:443)
#20 109.2     Resource temporarily unavailable
#20 109.2   Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.apidescription.server/index.json'.
#20 109.2   Resource temporarily unavailable (api.nuget.org:443)
#20 109.2     Resource temporarily unavailable
#20 109.2   Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/system.runtime.interopservices/index.json'.
#20 109.2   Resource temporarily unavailable (api.nuget.org:443)
#20 109.2     Resource temporarily unavailable
#20 109.2   Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/system.runtime.interopservices.runtimeinformation/index.json'.
#20 109.2   Resource temporarily unavailable (api.nuget.org:443)
#20 109.2     Resource temporarily unavailable
#20 109.2   Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/swashbuckle.aspnetcore.swagger/index.json'.
#20 109.2   Resource temporarily unavailable (api.nuget.org:443)
#20 109.2     Resource temporarily unavailable
#20 111.3   Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/serilog.sinks.periodicbatching/index.json'.
#20 111.3   Resource temporarily unavailable (api.nuget.org:443)
#20 111.3     Resource temporarily unavailable
#20 111.3   Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/serilog.sinks.file/index.json'.
#20 111.3   Resource temporarily unavailable (api.nuget.org:443)
#20 111.3     Resource temporarily unavailable
#20 111.3   Failed to download package 'Serilog.2.9.0' from 'https://api.nuget.org/v3-flatcontainer/serilog/2.9.0/serilog.2.9.0.nupkg'.
#20 111.3   Resource temporarily unavailable (api.nuget.org:443)
#20 111.3     Resource temporarily unavailable
#20 111.3   Failed to download package 'Serilog.2.8.0' from 'https://api.nuget.org/v3-flatcontainer/serilog/2.8.0/serilog.2.8.0.nupkg'.
#20 111.3   Resource temporarily unavailable (api.nuget.org:443)
#20 111.3     Resource temporarily unavailable
#20 111.3   Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/system.linq/index.json'.
#20 111.3   Resource temporarily unavailable (api.nuget.org:443)
#20 111.3     Resource temporarily unavailable
#20 116.9   Restored /src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj (in 1.7 min).
#20 160.8   Restored /src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj (in 43.97 sec).
#20 160.9   Restored /src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj (in 35 ms).
#20 160.9   Restored /src/BuildingBlocks/EventBus/EventBus/EventBus.csproj (in 8 ms).
#20 160.9   Restored /src/BuildingBlocks/Core/Core/Core.csproj (in 42 ms).
#20 169.2   Failed to download package 'System.Diagnostics.Debug.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.diagnostics.debug/4.3.0/system.diagnostics.debug.4.3.0.nupkg'.
#20 169.2   The download of 'https://api.nuget.org/v3-flatcontainer/system.diagnostics.debug/4.3.0/system.diagnostics.debug.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 169.2     Exception of type 'System.TimeoutException' was thrown.
#20 176.3   Failed to download package 'System.Linq.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.linq/4.3.0/system.linq.4.3.0.nupkg'.
#20 176.3   The download of 'https://api.nuget.org/v3-flatcontainer/system.linq/4.3.0/system.linq.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 176.3     Exception of type 'System.TimeoutException' was thrown.
#20 176.6   Failed to download package 'Swashbuckle.AspNetCore.SwaggerGen.6.1.4' from 'https://api.nuget.org/v3-flatcontainer/swashbuckle.aspnetcore.swaggergen/6.1.4/swashbuckle.aspnetcore.swaggergen.6.1.4.nupkg'.
#20 176.6   The download of 'https://api.nuget.org/v3-flatcontainer/swashbuckle.aspnetcore.swaggergen/6.1.4/swashbuckle.aspnetcore.swaggergen.6.1.4.nupkg' timed out because no data was received for 60000ms.
#20 176.6     Exception of type 'System.TimeoutException' was thrown.
#20 176.7   Failed to download package 'System.IO.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.io/4.3.0/system.io.4.3.0.nupkg'.
#20 176.7   The download of 'https://api.nuget.org/v3-flatcontainer/system.io/4.3.0/system.io.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 176.7     Exception of type 'System.TimeoutException' was thrown.
#20 176.9   Failed to download package 'Microsoft.Extensions.Configuration.Binder.2.0.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.configuration.binder/2.0.0/microsoft.extensions.configuration.binder.2.0.0.nupkg'.
#20 176.9   The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.configuration.binder/2.0.0/microsoft.extensions.configuration.binder.2.0.0.nupkg' timed out because no data was received for 60000ms.
#20 176.9     Exception of type 'System.TimeoutException' was thrown.
#20 177.7   Failed to download package 'System.Xml.XDocument.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.xml.xdocument/4.3.0/system.xml.xdocument.4.3.0.nupkg'.
#20 177.7   The download of 'https://api.nuget.org/v3-flatcontainer/system.xml.xdocument/4.3.0/system.xml.xdocument.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 177.7     Exception of type 'System.TimeoutException' was thrown.
#20 178.1   Failed to download package 'System.Runtime.Handles.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.runtime.handles/4.3.0/system.runtime.handles.4.3.0.nupkg'.
#20 178.1   The download of 'https://api.nuget.org/v3-flatcontainer/system.runtime.handles/4.3.0/system.runtime.handles.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 178.1     Exception of type 'System.TimeoutException' was thrown.
#20 179.2   Failed to download package 'System.Linq.Expressions.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.linq.expressions/4.3.0/system.linq.expressions.4.3.0.nupkg'.
#20 179.2   The download of 'https://api.nuget.org/v3-flatcontainer/system.linq.expressions/4.3.0/system.linq.expressions.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 179.2     Exception of type 'System.TimeoutException' was thrown.
#20 179.4   Failed to download package 'System.IO.Compression.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.io.compression/4.3.0/system.io.compression.4.3.0.nupkg'.
#20 179.4   The download of 'https://api.nuget.org/v3-flatcontainer/system.io.compression/4.3.0/system.io.compression.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 179.4     Exception of type 'System.TimeoutException' was thrown.
#20 179.4   Failed to download package 'System.Net.Sockets.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.net.sockets/4.3.0/system.net.sockets.4.3.0.nupkg'.
#20 179.4   The download of 'https://api.nuget.org/v3-flatcontainer/system.net.sockets/4.3.0/system.net.sockets.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 179.4     Exception of type 'System.TimeoutException' was thrown.
#20 179.6   Failed to download package 'System.Collections.NonGeneric.4.0.1' from 'https://api.nuget.org/v3-flatcontainer/system.collections.nongeneric/4.0.1/system.collections.nongeneric.4.0.1.nupkg'.
#20 179.6   The download of 'https://api.nuget.org/v3-flatcontainer/system.collections.nongeneric/4.0.1/system.collections.nongeneric.4.0.1.nupkg' timed out because no data was received for 60000ms.
#20 179.6     Exception of type 'System.TimeoutException' was thrown.
#20 179.8   Failed to download package 'System.Collections.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.collections/4.3.0/system.collections.4.3.0.nupkg'.
#20 179.8   The download of 'https://api.nuget.org/v3-flatcontainer/system.collections/4.3.0/system.collections.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 179.8     Exception of type 'System.TimeoutException' was thrown.
#20 179.9   Failed to download package 'System.Security.Cryptography.Primitives.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.security.cryptography.primitives/4.3.0/system.security.cryptography.primitives.4.3.0.nupkg'.
#20 179.9   The download of 'https://api.nuget.org/v3-flatcontainer/system.security.cryptography.primitives/4.3.0/system.security.cryptography.primitives.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 179.9     Exception of type 'System.TimeoutException' was thrown.
#20 180.2   Failed to download package 'System.Diagnostics.Tools.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.diagnostics.tools/4.3.0/system.diagnostics.tools.4.3.0.nupkg'.
#20 180.2   The download of 'https://api.nuget.org/v3-flatcontainer/system.diagnostics.tools/4.3.0/system.diagnostics.tools.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 180.2     Exception of type 'System.TimeoutException' was thrown.
#20 180.4   Failed to download package 'System.Runtime.InteropServices.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.runtime.interopservices/4.3.0/system.runtime.interopservices.4.3.0.nupkg'.
#20 180.4   The download of 'https://api.nuget.org/v3-flatcontainer/system.runtime.interopservices/4.3.0/system.runtime.interopservices.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 180.4     Exception of type 'System.TimeoutException' was thrown.
#20 181.8   Failed to download package 'System.Reflection.Extensions.4.0.1' from 'https://api.nuget.org/v3-flatcontainer/system.reflection.extensions/4.0.1/system.reflection.extensions.4.0.1.nupkg'.
#20 181.8   The download of 'https://api.nuget.org/v3-flatcontainer/system.reflection.extensions/4.0.1/system.reflection.extensions.4.0.1.nupkg' timed out because no data was received for 60000ms.
#20 181.8     Exception of type 'System.TimeoutException' was thrown.
#20 181.9   Failed to download package 'System.Runtime.Numerics.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.runtime.numerics/4.3.0/system.runtime.numerics.4.3.0.nupkg'.
#20 181.9   The download of 'https://api.nuget.org/v3-flatcontainer/system.runtime.numerics/4.3.0/system.runtime.numerics.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 181.9     Exception of type 'System.TimeoutException' was thrown.
#20 182.0   Failed to download package 'System.Reflection.4.1.0' from 'https://api.nuget.org/v3-flatcontainer/system.reflection/4.1.0/system.reflection.4.1.0.nupkg'.
#20 182.0   The download of 'https://api.nuget.org/v3-flatcontainer/system.reflection/4.1.0/system.reflection.4.1.0.nupkg' timed out because no data was received for 60000ms.
#20 182.1     Exception of type 'System.TimeoutException' was thrown.
#20 182.3   Failed to download package 'System.Threading.4.0.11' from 'https://api.nuget.org/v3-flatcontainer/system.threading/4.0.11/system.threading.4.0.11.nupkg'.
#20 182.3   The download of 'https://api.nuget.org/v3-flatcontainer/system.threading/4.0.11/system.threading.4.0.11.nupkg' timed out because no data was received for 60000ms.
#20 182.3     Exception of type 'System.TimeoutException' was thrown.
#20 182.8   Failed to download package 'System.Runtime.Extensions.4.1.0' from 'https://api.nuget.org/v3-flatcontainer/system.runtime.extensions/4.1.0/system.runtime.extensions.4.1.0.nupkg'.
#20 182.8   The download of 'https://api.nuget.org/v3-flatcontainer/system.runtime.extensions/4.1.0/system.runtime.extensions.4.1.0.nupkg' timed out because no data was received for 60000ms.
#20 182.8     Exception of type 'System.TimeoutException' was thrown.
#20 183.1   Failed to download package 'Newtonsoft.Json.12.0.2' from 'https://api.nuget.org/v3-flatcontainer/newtonsoft.json/12.0.2/newtonsoft.json.12.0.2.nupkg'.
#20 183.1   The download of 'https://api.nuget.org/v3-flatcontainer/newtonsoft.json/12.0.2/newtonsoft.json.12.0.2.nupkg' timed out because no data was received for 60000ms.
#20 183.1     Exception of type 'System.TimeoutException' was thrown.
#20 183.9   Failed to download package 'Serilog.2.8.0' from 'https://api.nuget.org/v3-flatcontainer/serilog/2.8.0/serilog.2.8.0.nupkg'.
#20 183.9   The download of 'https://api.nuget.org/v3-flatcontainer/serilog/2.8.0/serilog.2.8.0.nupkg' timed out because no data was received for 60000ms.
#20 183.9     Exception of type 'System.TimeoutException' was thrown.
#20 183.9   Failed to download package 'System.Security.Cryptography.Encoding.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.security.cryptography.encoding/4.3.0/system.security.cryptography.encoding.4.3.0.nupkg'.
#20 183.9   The download of 'https://api.nuget.org/v3-flatcontainer/system.security.cryptography.encoding/4.3.0/system.security.cryptography.encoding.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 183.9     Exception of type 'System.TimeoutException' was thrown.
#20 185.8   Failed to download package 'System.Net.Http.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.net.http/4.3.0/system.net.http.4.3.0.nupkg'.
#20 185.8   The download of 'https://api.nuget.org/v3-flatcontainer/system.net.http/4.3.0/system.net.http.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 185.8     Exception of type 'System.TimeoutException' was thrown.
#20 186.0   Failed to download package 'Microsoft.Extensions.DependencyInjection.Abstractions.3.1.2' from 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.dependencyinjection.abstractions/3.1.2/microsoft.extensions.dependencyinjection.abstractions.3.1.2.nupkg'.
#20 186.0   The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.dependencyinjection.abstractions/3.1.2/microsoft.extensions.dependencyinjection.abstractions.3.1.2.nupkg' timed out because no data was received for 60000ms.
#20 186.0     Exception of type 'System.TimeoutException' was thrown.
#20 187.0   Failed to download package 'System.Reflection.Primitives.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.reflection.primitives/4.3.0/system.reflection.primitives.4.3.0.nupkg'.
#20 187.0   The download of 'https://api.nuget.org/v3-flatcontainer/system.reflection.primitives/4.3.0/system.reflection.primitives.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 187.0     Exception of type 'System.TimeoutException' was thrown.
#20 187.8   Failed to download package 'System.Diagnostics.DiagnosticSource.5.0.0' from 'https://api.nuget.org/v3-flatcontainer/system.diagnostics.diagnosticsource/5.0.0/system.diagnostics.diagnosticsource.5.0.0.nupkg'.
#20 187.8   The download of 'https://api.nuget.org/v3-flatcontainer/system.diagnostics.diagnosticsource/5.0.0/system.diagnostics.diagnosticsource.5.0.0.nupkg' timed out because no data was received for 60000ms.
#20 187.8     Exception of type 'System.TimeoutException' was thrown.
#20 188.6   Failed to download package 'Newtonsoft.Json.9.0.1' from 'https://api.nuget.org/v3-flatcontainer/newtonsoft.json/9.0.1/newtonsoft.json.9.0.1.nupkg'.
#20 188.6   The download of 'https://api.nuget.org/v3-flatcontainer/newtonsoft.json/9.0.1/newtonsoft.json.9.0.1.nupkg' timed out because no data was received for 60000ms.
#20 188.6     Exception of type 'System.TimeoutException' was thrown.
#20 188.9   Failed to download package 'System.Runtime.4.1.0' from 'https://api.nuget.org/v3-flatcontainer/system.runtime/4.1.0/system.runtime.4.1.0.nupkg'.
#20 188.9   The download of 'https://api.nuget.org/v3-flatcontainer/system.runtime/4.1.0/system.runtime.4.1.0.nupkg' timed out because no data was received for 60000ms.
#20 188.9     Exception of type 'System.TimeoutException' was thrown.
#20 189.2   Failed to download package 'Microsoft.EntityFrameworkCore.5.0.1' from 'https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore/5.0.1/microsoft.entityframeworkcore.5.0.1.nupkg'.
#20 189.2   The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore/5.0.1/microsoft.entityframeworkcore.5.0.1.nupkg' timed out because no data was received for 60000ms.
#20 189.2     Exception of type 'System.TimeoutException' was thrown.
#20 189.3   Failed to download package 'System.Globalization.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.globalization/4.3.0/system.globalization.4.3.0.nupkg'.
#20 189.3   The download of 'https://api.nuget.org/v3-flatcontainer/system.globalization/4.3.0/system.globalization.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 189.3     Exception of type 'System.TimeoutException' was thrown.
#20 190.0   Failed to download package 'Serilog.Sinks.File.4.1.0' from 'https://api.nuget.org/v3-flatcontainer/serilog.sinks.file/4.1.0/serilog.sinks.file.4.1.0.nupkg'.
#20 190.0   The download of 'https://api.nuget.org/v3-flatcontainer/serilog.sinks.file/4.1.0/serilog.sinks.file.4.1.0.nupkg' timed out because no data was received for 60000ms.
#20 190.0     Exception of type 'System.TimeoutException' was thrown.
#20 190.5   Failed to download package 'FluentValidation.10.2.3' from 'https://api.nuget.org/v3-flatcontainer/fluentvalidation/10.2.3/fluentvalidation.10.2.3.nupkg'.
#20 190.5   The download of 'https://api.nuget.org/v3-flatcontainer/fluentvalidation/10.2.3/fluentvalidation.10.2.3.nupkg' timed out because no data was received for 60000ms.
#20 190.5     Exception of type 'System.TimeoutException' was thrown.
#20 192.2   Failed to download package 'System.Text.RegularExpressions.4.1.0' from 'https://api.nuget.org/v3-flatcontainer/system.text.regularexpressions/4.1.0/system.text.regularexpressions.4.1.0.nupkg'.
#20 192.2   The download of 'https://api.nuget.org/v3-flatcontainer/system.text.regularexpressions/4.1.0/system.text.regularexpressions.4.1.0.nupkg' timed out because no data was received for 60000ms.
#20 192.2     Exception of type 'System.TimeoutException' was thrown.
#20 192.3   Failed to download package 'System.Runtime.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.runtime/4.3.0/system.runtime.4.3.0.nupkg'.
#20 192.3   The download of 'https://api.nuget.org/v3-flatcontainer/system.runtime/4.3.0/system.runtime.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 192.3     Exception of type 'System.TimeoutException' was thrown.
#20 192.7   Failed to download package 'System.Text.Encoding.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.text.encoding/4.3.0/system.text.encoding.4.3.0.nupkg'.
#20 192.7   The download of 'https://api.nuget.org/v3-flatcontainer/system.text.encoding/4.3.0/system.text.encoding.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 192.7     Exception of type 'System.TimeoutException' was thrown.
#20 197.2   Failed to download package 'System.Collections.Concurrent.4.0.12' from 'https://api.nuget.org/v3-flatcontainer/system.collections.concurrent/4.0.12/system.collections.concurrent.4.0.12.nupkg'.
#20 197.2   The download of 'https://api.nuget.org/v3-flatcontainer/system.collections.concurrent/4.0.12/system.collections.concurrent.4.0.12.nupkg' timed out because no data was received for 60000ms.
#20 197.2     Exception of type 'System.TimeoutException' was thrown.
#20 205.0   Failed to download package 'System.Linq.4.1.0' from 'https://api.nuget.org/v3-flatcontainer/system.linq/4.1.0/system.linq.4.1.0.nupkg'.
#20 205.0   The download of 'https://api.nuget.org/v3-flatcontainer/system.linq/4.1.0/system.linq.4.1.0.nupkg' timed out because no data was received for 60000ms.
#20 205.0     Exception of type 'System.TimeoutException' was thrown.
#20 217.0   Failed to download package 'System.Reflection.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.reflection/4.3.0/system.reflection.4.3.0.nupkg'.
#20 217.0   The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.reflection/4.3.0/system.reflection.4.3.0.nupkg' has timed out after 100000ms.
#20 218.2   Failed to download package 'Serilog.Sinks.PeriodicBatching.2.3.0' from 'https://api.nuget.org/v3-flatcontainer/serilog.sinks.periodicbatching/2.3.0/serilog.sinks.periodicbatching.2.3.0.nupkg'.
#20 218.2   The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/serilog.sinks.periodicbatching/2.3.0/serilog.sinks.periodicbatching.2.3.0.nupkg' has timed out after 100000ms.
#20 243.8   Failed to download package 'System.Reflection.4.1.0' from 'https://api.nuget.org/v3-flatcontainer/system.reflection/4.1.0/system.reflection.4.1.0.nupkg'.
#20 243.8   The download of 'https://api.nuget.org/v3-flatcontainer/system.reflection/4.1.0/system.reflection.4.1.0.nupkg' timed out because no data was received for 60000ms.
#20 243.8     Exception of type 'System.TimeoutException' was thrown.
#20 254.7   Restored /src/BuildingBlocks/Core/Core.WebApi/Core.WebApi.csproj (in 1.56 min).
#20 258.4   Failed to download package 'System.Reflection.Primitives.4.3.0' from 'https://api.nuget.org/v3-flatcontainer/system.reflection.primitives/4.3.0/system.reflection.primitives.4.3.0.nupkg'.
#20 258.4   The download of 'https://api.nuget.org/v3-flatcontainer/system.reflection.primitives/4.3.0/system.reflection.primitives.4.3.0.nupkg' timed out because no data was received for 60000ms.
#20 258.4     Exception of type 'System.TimeoutException' was thrown.
#20 262.4   Failed to download package 'Microsoft.EntityFrameworkCore.5.0.1' from 'https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore/5.0.1/microsoft.entityframeworkcore.5.0.1.nupkg'.
#20 262.4   The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore/5.0.1/microsoft.entityframeworkcore.5.0.1.nupkg' timed out because no data was received for 60000ms.
#20 262.4     Exception of type 'System.TimeoutException' was thrown.
#20 318.8   Restored /src/Services/WebSite/WebSite.API/WebSite.API.csproj (in 3.73 min).

您可以尝试添加标志——disable-parallel。它完成了,但是花了太长时间。

你也可以用选项——configfile设置你自己的nuget文件(也许实验属性maxHttpRequestsPerSource,尝试将其值降低到5或10)。

对我来说,设置一个nuget文件+ packages文件夹(—packages)有点奏效,但我仍然不时地遇到一些随机失败。

这个问题有很多不同的形式,所以我将留下一些链接来帮助我解决这个问题,即使没有找到确定的解决方案:

  • https://github.com/NuGet/Home/issues/10275
  • https://github.com/dotnet/dotnet-docker/issues/1670
  • https://github.com/NuGet/Home/issues/9020

相关内容

  • 没有找到相关文章

最新更新