Description
I somewhat stumbled on this one while running out of space on my local machine. I noticed that most of the helix images are pretty large. For example Ubuntu 18 -> 1.5G
$ docker image ls
mcr.microsoft.com/dotnet-buildtools/prereqs ubuntu-18.04-helix-amd64-20230216023557-4443d0d 6d7d1241e2c6 7 seconds ago 1.52GB
It seems like many of the images are pulling build tools directly or indirectly by relaying on the prereq
base image.
And in both cases they seems to be geared toward building runtime not executing tests. This may be for historical reasons.
I did little fiddling (https://github.com/dotnet/dotnet-buildtools-prereqs-docker/compare/ubu18?expand=1) and I can get the image to about 1/3
mcr.microsoft.com/dotnet-buildtools/prereqs ubuntu-18.04-helix-amd64-20230216060058-4443d0d 07e33080f83d 5 seconds ago 593MB
even less with restricted locale
mcr.microsoft.com/dotnet-buildtools/prereqs ubuntu-18.04-helix-amd64-20230216061525-4443d0d c2d0fb3b5d9c 52 seconds ago 463MB
is the ~ 1G per image saving interesting and worth of the troubles @MattGal @mthalman ?
I'm reasonably confident that the resulting image would be capable of running runtime
tests.
But I don't have really visibility to other repos and any historical reasons.
If we decouple the dependency on the base local image we may see more duplication on Dockerfile - but probably not too much.