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>
17 lines
548 B
Docker
17 lines
548 B
Docker
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
|
|
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
|
|
ENV HOME=/home/nonroot
|
|
ENV DOTNET_CLI_HOME=/home/nonroot
|
|
WORKDIR /app
|
|
USER 65532
|