File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,14 @@ RUN dotnet restore -a $TARGETARCH
3636COPY src/Exercism.TestRunner.CSharp/ ./
3737RUN dotnet publish -a $TARGETARCH --output /opt/test-runner --no-restore
3838
39+ # Slim the pre-installed NuGet cache before it is copied into the runtime image.
40+ # Restore from the global packages folder uses the extracted files, so the .nupkg
41+ # archives, foreign-platform Capstone natives (a BenchmarkDotNet disassembly
42+ # dependency) and the build-only crossgen2 tool are all redundant.
43+ RUN find /root/.nuget/packages -type f \( -name '*.nupkg' -o -name '*.snupkg' \) -delete && \
44+ find /root/.nuget/packages/gee.external.capstone -type d \( -name 'win-*' -o -name 'osx-*' -o -name 'linux-x86' -o -name 'linux-arm' \) -prune -exec rm -rf {} + && \
45+ rm -rf /root/.nuget/packages/microsoft.netcore.app.crossgen2.*
46+
3947# Build runtime image
4048FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0.300-alpine3.23 AS runtime
4149
You can’t perform that action at this time.
0 commit comments