From 5498a6633ec92d980f49c39469403d8b21c6febc Mon Sep 17 00:00:00 2001 From: Rey Abolofia Date: Mon, 6 Jan 2025 12:05:00 -0800 Subject: [PATCH] Remove *.dist-info directories except entry_points.txt files. --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 610fef38..ff0e6217 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,9 @@ RUN rm ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_stacktrace*.so RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/libdd_wrapper*.so RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/ddup/_ddup.*.so RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/stack_v2/_stack_v2.*.so -RUN find . -name "*.dist-info" -type d | xargs rm -rf +# remove *.dist-info directories except any entry_points.txt files +RUN find ./python/lib/$runtime/site-packages/*.dist-info -not -name "entry_points.txt" -type f -delete +RUN find ./python/lib/$runtime/site-packages -type d -empty -delete # Precompile all .pyc files and remove .py files. This speeds up load time. # Compile with optimization level 2 (-OO) and PYTHONNODEBUGRANGES=1 to redtce