Currently the SDK Dockerfiles use the following pattern to initialize the package cache.
# Trigger the population of the local package cache
RUN mkdir warmup \
&& cd warmup \
&& dotnet new \
&& cd .. \
&& rm -rf warmup \
&& rm -rf /tmp/NuGetScratch
This pattern was necessary at the time it was written and can now be simplified. Invoking any dotnet cmd will trigger the first run experience. Additionally with the NuGetFallback folder, CLI no longer utilizes NuGet to initialize the package cache therefore the NuGetScratch directory is no longer created.