dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.71k stars 1.06k forks source link

How to suppress the initial "populate your local package cache" restore #8363

Closed NinoFloris closed 4 years ago

NinoFloris commented 7 years ago

We are running the dotnet docker containers (https://github.com/dotnet/dotnet-docker) on http://www.wercker.com/ where we can cache the packages to the cache that lives across build runs.

We set our package path to this folder via the --packages switch

Problem is that it seems dotnet restore stores the fact it has or has not done this initial restore once already in a different location from the packages which results in this happening on every build run because the container obviously is discarded

We can either create the file dotnet restore checks beforehand (unknown where that is) or it could maybe be incorporated in a switch to the restore command

livarcocc commented 7 years ago

There is an environment variable that you can set that will prevent dotnet from running the first run experience: DOTNET_SKIP_FIRST_TIME_EXPERIENCE. Just set it to true.

NinoFloris commented 7 years ago

Thanks!