Skip to content

.NET 8 samples size report #4756

@richlander

Description

@richlander

We're working on a samples update for .NET 8 at #4742. This is a separate issue to track size. It's pretty interesting. I wrote a tool that builds all the Dockerfiles in a directory (using the Dockerfile name as the tag name) making it straightforward to identify which image is which.

dockerfile is always Debian and .chiseled is Ubuntu Chiseled (distroless). All other tags should be self-descriptive. If not, please ask.

#4759 is a .NET 7 baseline size report.

Both x64 and Arm64 reports are provided. These chip types support different ISAs (naturally) and the amount of code needed is not the same (which directly contributes to size). Arm64 biases to bigger.

aspnetapp (framework-dependent)

x64:

$ docker images --filter="reference=dockerfile*" | sort -k7 -h  
REPOSITORY                      TAG       IMAGE ID       CREATED         SIZE
dockerfile.alpine-composite     latest    72c7473be401   3 minutes ago   106MB
dockerfile.chiseled-composite   latest    b37753a99e89   3 minutes ago   107MB
dockerfile.alpine               latest    23fe072074c9   2 minutes ago   116MB
dockerfile.chiseled             latest    4383cd6a78da   2 minutes ago   116MB
dockerfile.alpine-icu           latest    e6a039a882d6   2 minutes ago   152MB
dockerfile.ubuntu               latest    58239554015a   2 minutes ago   219MB
dockerfile.debian               latest    7b93d893cfb2   3 minutes ago   226MB
dockerfile                      latest    7b93d893cfb2   3 minutes ago   226MB

Arm64:

$ docker images --filter="reference=dockerfile*" | sort -k7 -h
REPOSITORY                      TAG       IMAGE ID       CREATED       SIZE
dockerfile.chiseled-composite   latest    a94fee97b662   5 hours ago   108MB
dockerfile.alpine-composite     latest    5bf8a60475c3   5 hours ago   111MB
dockerfile.chiseled             latest    23265bd775c1   5 hours ago   122MB
dockerfile.alpine               latest    d316c1226ab1   5 hours ago   126MB
dockerfile.alpine-icu           latest    118f5acce205   5 hours ago   163MB
dockerfile.ubuntu               latest    36b387d60293   5 hours ago   219MB
dockerfile                      latest    e463766d8467   5 hours ago   257MB
dockerfile.debian               latest    e463766d8467   5 hours ago   257MB

dotnetapp (framework-dependent)

x64:

$ docker images --filter="reference=dockerfile*" | sort -k8 -h  
REPOSITORY              TAG       IMAGE ID       CREATED              SIZE
dockerfile.alpine       latest    c5cab64c3bd8   About a minute ago   84.5MB
dockerfile.chiseled     latest    dcec0223422b   About a minute ago   85.1MB
dockerfile.alpine-icu   latest    970603f24a34   About a minute ago   121MB
dockerfile.ubuntu       latest    d507002c66a4   About a minute ago   188MB
dockerfile.debian       latest    91df0d0313c2   About a minute ago   195MB
dockerfile              latest    91df0d0313c2   About a minute ago   195MB

Amr64:

$ docker images --filter="reference=dockerfile*" | sort -k7 -h   
REPOSITORY              TAG       IMAGE ID       CREATED      SIZE
dockerfile.chiseled     latest    41b4c15f43a6   5 days ago   88.5MB
dockerfile.alpine       latest    26594f7b4b6e   5 days ago   91.8MB
dockerfile.alpine-icu   latest    6caefda3b6dc   5 days ago   129MB
dockerfile.ubuntu       latest    a9249dbd5d4f   5 days ago   185MB
dockerfile              latest    eb30f6e66b17   5 days ago   224MB
dockerfile.debian       latest    eb30f6e66b17   5 days ago   224MB

releasesapi (AOT / self-contained)

x64:

REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
dockerfile   latest    e7e815843c6d   1 second ago   22.6MB

Arm64:

docker images --filter="reference=dockerfile*" | sort -k7 -h      
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
dockerfile   latest    f070e91e24e9   4 hours ago   23.6MB

releasesapp (Single file / self-contained)

x64:

$ docker images --filter="reference=dockerfile*" | sort -k7 -h  
REPOSITORY            TAG       IMAGE ID       CREATED          SIZE
dockerfile.alpine     latest    e641919d7c43   29 seconds ago   36.5MB
dockerfile.chiseled   latest    b06fc6521845   49 seconds ago   37.3MB
dockerfile            latest    37a4a2b0d399   11 seconds ago   147MB

Arm64:

$ docker images --filter="reference=dockerfile*" | sort -k7 -h           
REPOSITORY            TAG       IMAGE ID       CREATED         SIZE
dockerfile.chiseled   latest    9e34a7c5c5a6   2 minutes ago   35.7MB
dockerfile.alpine     latest    9ba537b8b99b   3 minutes ago   39MB
dockerfile            latest    d212c9569f8d   2 minutes ago   171MB

Delete the images

Off topic, but here's how I delete these images.

docker rmi -f $(docker images --filter="reference=dockerfile*" -q) 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions