sdk-container-builds
sdk-container-builds copied to clipboard
Layered Image Builds
(I am not sure if container builds already do this)
Currently, when building container images for multi-project solutions, it would be valuable to have the .NET SDK automatically create separate image layers for each project in the solution. This could potentially include:
- A dedicated layer for each project's build output
- Optionally, separate layers for restore operations
While this is achievable manually in Dockerfiles, it requires careful file selection between build stages to COPY. The .NET SDK already has the necessary dependency graph information to optimally:
- Determine build order
- Identify which files belong to which project
- Create efficient layer caching boundaries
I think there's a proposal for "incremental builds" which may or may not overlap with this request. I would expect at the very least this could optimize storage if you are changing leaf projects more frequently, but incremental builds could likely play into this as well.