Docker Community Forums

Share and learn in the Docker community.

Smaller Windows Container Images For .NET Framework


(Leroy Jenkins Coder) #1

I recently created a docker image using the microsoft/aspnet image. It’s huge (13.6GB) in comparison with the alpine (~5MB) and even nanoserver images when using aspnet core. Are there any smaller image alternatives out there? I’m stuck to using a web application that isn’t .net core. Are there any experimental/new images out there that are a lot smaller in comparison that support non-core ASP.Net? I know one answer would be to just make my application asp.net core. I don’t have that option right now, unfortunately. Any and all help would be greatly appreciated.

Thanks!


(Richardgavel) #2

Which version of Windows are you using? LTSC? 1709? 1803? Which tag are you using? I ask because if you look at the base images for windowsservercore (https://hub.docker.com/r/microsoft/windowsservercore/tags/), 1709 and 1803 are much smaller base images. However, you need to be running at least the corresponding version on your host.


(Leroy Jenkins Coder) #3

I’m using just Windows 10 for local development. I pulled the windowsservercore image and it’s 10.9GB. I’m looking for something that’s maybe 2-3GB max. I’m guessing that nothing like that exists for non-core apps. That really sucks.

microsoft/windowsservercore   latest    f8dc15f55717   12 days ago     10.9GB
microsoft/nanoserver          latest    4c872414bf9d   12 days ago     1.17GB
microsoft/aspnet              latest    02dfa1e1baeb   5 weeks ago     13.6GB
nanoserver/iis                latest    7eac2eab1a5c   4 months ago    1.29GB

(Richardgavel) #4

There’re more than just “Windows 10” to what you are running. Run “winver” and also look at https://www.microsoft.com/en-us/itpro/windows-10/release-information.


(Leroy Jenkins Coder) #5

Sorry. It’s version 1607.


(Richardgavel) #6

That’s a pretty old version of Windows 10. I’d run Windows Update to get to 1803 (don’t worry, that’s not the October update that’s deleting files off people’s hard drives). Each subsequent update to Win 10 tends to bring improvements to container functionality. Once you do that, you’ll be able to run the corresponding microsoft/windowsservercore:1803 image, which is much smaller.