ASP.NET Core 2.0 introduces a meta package to reference the major packages that make up the web framework. The Microsoft dotnet docker sdk image caches these packages from nuget.org in the image. This has the advantage of both speeding up the build and not wasting the bandwidth of downloading for each build. With my internet connection/machine this takes about 1-2min and downloads 130MB of packages. ``` $ rm -rf ~/.nuget ~/.local/share/NuGet/; time dotnet new mvc real 1m47.271s $ du -ch $(find ~/.nuget/packages -name '*.nupkg') | tail -1 129M total ``` Since we are not caching these packages, this restore currently happens for every s2i build.
Andrew, how about we do this nuget cache warmup in the 2.0 s2i builder image? This should solve the issue, right?
Severin, I had implemented that but this is being removed as part of https://github.com/redhat-developer/s2i-dotnetcore/pull/88/files#diff-6f2669af799dae0df04fa82a92c1d7f9L60. The motivation is we are not building these packages.
I'm closing this as "Won't Fix", though maybe the correct answer is actually "Can't Fix". As described here, source build issues in 2.x prevent us from shipping with the packages necessary to get rid of this, and any future development is going into the 3.x versions. In 3.x, the design has been changed to no longer need to grab these packages at runtime, including providing proper source built packages. So the suggestion might be to upgrade to 3.x For 2.x, there is a workaround that can be done, but it does require using non-source built packages that we can't ship. We have imagestreams for 2.x packages that pre-cache ASP.NET. This was implemented in this PR upstream: https://github.com/redhat-developer/s2i-dotnetcore/pull/280 In general, information on that can be found upstream: https://github.com/redhat-developer/s2i-dotnetcore