I recently migrated an ASP.NET Core running in a Windows container provided by Microsoft from .NET 7 to .NET 8.
The official default ASP.NET Core image is now 10 times bigger. Why?
> docker images
mcr.microsoft.com/dotnet/aspnet 8.0.0-windowsservercore-ltsc2022 175b932722fc 8 weeks ago 4.36GB
mcr.microsoft.com/dotnet/aspnet 7.0 6a62cbd93ce2 3 months ago 393MB
For Windows-based container images (otherwise you may be comparing Linux-based and Windows-based images) according to the Nano Server 2022 amd64 Tags table from the Docker hub page:
7.0 was using Nano Server as base image:
While you have switched to one using Windows Server Core 2022:
Try using
8.0-nanoserver-ltsc2022as base.See also Nano Server x Server Core x Server - Which base image is the right one for you? article.