Strip unused SDK components to reduce image size
Remove templates, TestHostNetFramework, and DotnetTools from SDK image. These are not needed for dotnet restore/build/publish and save ~124 MB. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
a677ab6d9d
commit
bb3f52b265
@ -2,6 +2,10 @@ FROM scratch
|
||||
ARG TARGETARCH
|
||||
ADD build-${TARGETARCH}/sdk/rootfs.tar.gz /
|
||||
COPY dotnet-${TARGETARCH}/sdk/ /usr/share/dotnet/
|
||||
# Strip components not needed for building
|
||||
RUN rm -rf /usr/share/dotnet/templates \
|
||||
/usr/share/dotnet/sdk/*/TestHostNetFramework \
|
||||
/usr/share/dotnet/sdk/*/DotnetTools
|
||||
ENV DOTNET_ROOT=/usr/share/dotnet
|
||||
ENV PATH="/usr/share/dotnet:${PATH}"
|
||||
ENV DOTNET_RUNNING_IN_CONTAINER=true
|
||||
|
||||
Loading…
Reference in New Issue
Block a user