|
|
Posted on 6/5/2022 10:02:29 PM
|
|
|
|

Requirements: Package the project that previously used ASP.NET Core 6.0 into a Docker image, and then run it on the router (openwrt), and when executing the package into a Docker image, a timeout error will occur when restoring the Nuget package with dotnet restore, as shown in the figure below:
Determining projects to restore... Failed to download package 'SkiaSharp.2.80.3' from 'https://api.nuget.org/v3-flatcontainer/skiasharp/2.80.3/skiasharp.2.80.3.nupkg'. The download of 'https://api.nuget.org/v3-flatcontainer/skiasharp/2.80.3/skiasharp.2.80.3.nupkg' timed out because no data was received for 60000ms. Exception of type 'System.TimeoutException' was thrown. Failed to download package 'SkiaSharp.NativeAssets.Linux.2.80.3' from ' https://api.nuget.org/v3-flatcontainer/skiasharp.nativeassets.linux/2.80.3/skiasharp.nativeassets.linux.2.80.3.nupkg'. The download of 'https://api.nuget.org/v3-flatcontainer/skiasharp.nativeassets.linux/2.80.3/skiasharp.nativeassets.linux.2.80.3.nupkg' timed out because no data was received for 60000ms. Exception of type 'System.TimeoutException' was thrown. The project Dockerfile is configured by default:
The package into docker image command is as follows:
It was discovered through the search engine that other users were also experiencing similar problems, link:The hyperlink login is visible.
According to the answers of netizens, try to increase--disable-parallelParameter parallelism is disabled, modified as follows:
Discoveries will still appearSystem.TimeoutExceptionSince it is a timeout to restore the nuget package timeout, why can't we change the source? Decisively replaced with Tencent's nuget source, with the following reference:
Modify the Dockerfile file, remove the default nuget.org, and add the source of Tencent Cloud, as follows:
At lastSuccessfully packaged into a docker image, it took 22 seconds to restore the nuget package, there is no timeout problem, as shown in the figure below:
(End)
|
Previous:fdisk_dos_fix_chs: symbol not foundNext:Newcomers post, PHP summarizes 6 ways to traverse arrays
|