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

Image size monitoring

Open mthalman opened this issue 4 years ago • 2 comments

Maintaining an appropriate image size has always been a priority for the .NET Docker images. Keeping image size down saves money and push/pull time, especially since it has a multiplying effect when images get built on top of other images.

Currently there is a basic system in place for monitoring image sizes in the nightly branch. There are some gaps in this implementation:

  • Identifying when an update has changed the image size can sometimes be difficult. Right now, the system allows a certain percentage of variance in the actual image size compared to the stored baseline. The system will cause a failure if the image size difference goes beyond that threshold. The problem is that an update may have occurred that changed the image size to be just within the threshold and then a subsequent minor change down the road pushes it past the threshold. In such a scenario, you care more about the initial larger update than the minor but it can be difficult to identify when that change occurred.
  • The system only tracks the total image size. This makes it difficult to identify which layer actually produced an image size change. You need to identify the digest earlier version of the image and compare its layers side by side with the current version of the image.
  • There's not a good way to visualize the historical change in the image size. You'd have to use file history in git to track the different image size values that were contained in the baseline which is rather cumbersome. But that only tracks what the baseline was set to, not the actual image size.

The proposal is to develop a monitoring system that can track the sizes of each layer of the images and store this data in a way that it can be queried and tracked historically.

mthalman avatar May 27 '20 15:05 mthalman

We have an existing issue for tracking layer size at https://github.com/dotnet/docker-tools/issues/745

mthalman avatar Apr 19 '23 18:04 mthalman

[Triage] Benefits of tracking image size:

  • Identify unintended size increase/decrease and what caused it
  • Validate that changes made to decrease image size actually had the impact we expected

mthalman avatar Apr 19 '23 18:04 mthalman