Drop use of buildpack-deps as base image by mthalman · Pull Request #1848 · dotnet/dotnet-docker (original) (raw)

Here's a comparison of the benefits these changes provide in terms of the download cost savings. The canonical scenario here is a multi-stage Dockerfile that builds and publishes an ASP.NET app (see the sample ASP.NET Dockerfile). The scenario involves first pulling the SDK image in order to build the application and then pulling the ASP.NET image to contain the published application. Before these changes, there was no layer sharing between the ASP.NET image and the SDK image. This was wasteful because the SDK image does contain ASP.NET bits; it just wasn't based on the ASP.NET image. With the changes that were made here, the SDK is now based on the ASP.NET image which means that once you've pulled the SDK image, you now essentially have the ASP.NET image as well. This provides substantial download savings when both images need to be pulled.

Focal

Before After
1. Pull SDK image 268 MB 232 MB
2. Pull ASP.NET image 64 MB 10 KB (manifest only)

Net download savings: 100 MB (-30%)

Buster

Before After
1. Pull SDK image 280 MB 218 MB
2. Pull ASP.NET image 84 MB 4 KB (manifest only)

Net download savings: 146 MB (-40%)