dotnet-docker icon indicating copy to clipboard operation
dotnet-docker copied to clipboard

Provide guidance on utilizing NuGet package caches for build scenarios

Open MichaelSimons opened this issue 6 years ago • 2 comments

Within the .NET community there are users asking/discussing the best/recommended patterns for utilizing a NuGet package cache while building their .NET projects with Docker. Here is a recent example.

There are two main scenarios which have very different solutions.

  1. Building .NET projects within Dockerfiles
  2. Building .NET projects within a running container

It would be beneficial to have some guidance for these scenarios. Creating a snippet on this topic feels like a good way to capture the guidance.

MichaelSimons avatar Mar 30 '20 19:03 MichaelSimons

[Triage] The mount feature of Docker can help with implementing this, described here: https://github.com/dotnet/dotnet-docker/issues/2457.

mthalman avatar Apr 19 '23 18:04 mthalman

Here's an example: https://github.com/dotnet/dotnet-docker/blob/main/samples/releasesapi/Dockerfile.ubuntu-chiseled. It would be good to have a performance test (of sorts) that validates the benefit of the mounts.

docker init Dockerfiles also use this syntax.

richlander avatar May 24 '24 15:05 richlander