Created
August 10, 2020 11:56
-
-
Save melvinlee/47cbc24d83ada693696446aa92debe33 to your computer and use it in GitHub Desktop.
Baked NuGet packages cache into base images.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find . -name "*.csproj" -print0 \ | |
| | tar -cvf projectfiles.tar --null -T - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM mcr.microsoft.com/dotnet/core/sdk:3.1 | |
| # warmup NuGet package cache | |
| WORKDIR /sln | |
| COPY *.sln . | |
| COPY projectfiles.tar . | |
| RUN tar -xvf projectfiles.tar | |
| RUN dotnet restore \ | |
| --source https://api.nuget.org/v3/index.json | |
| WORKDIR / | |
| RUN rm -rf /sln |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment