dotnet / dotnet/dotnet-docker

Consider producing a distroless SDK

Open
#4,942 9 comments 8 reactions 0 assignees View on GitHub
area-dockerfiles
Dominant language
Dockerfile
Stars
4.9k
Forks
2k
Avg merge
1d 14h
Merged PRs (30d)
26

Description

Today, we produce distroless variants for all image types except SDK. In thinking more about it, it isn't obvious why that is. The benefits of distroless and the reasons why you might not be able to use it seem to apply equally to runtime as SDK.

I did some basic tests with Mariner. Distroless dropped the size of the image by nearly half and gave me the benefits of non-root. We may want to add the shell back for this scenario, but that's a design/policy point.

For users that use `RUN` commands solely for `dotnet`, a distroless SDK seems like 100% win w/no downside. It also means that you get to share layers between runtime and SDK which you cannot w/today's approach (with distroless). So, not only will SDK be smaller, but your overall layer pull for multi-stage build will be MUCH smaller.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.