Skip to content
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ RUN pip install --no-cache-dir . -t ./python/lib/$runtime/site-packages
RUN rm -rf ./python/lib/$runtime/site-packages/botocore*
RUN rm -rf ./python/lib/$runtime/site-packages/setuptools
RUN rm -rf ./python/lib/$runtime/site-packages/jsonschema/tests
RUN rm -f ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_ast/iastpatch*.so
RUN rm -rf ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_taint_tracking/_vendor
RUN rm -f ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_taint_tracking/*.so
RUN rm -f ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_stacktrace*.so
RUN rm -rf ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast
RUN rm -rf ./python/lib/$runtime/site-packages/ddtrace/internal/test_visibility
# Dogshell
RUN rm -rf ./python/lib/$runtime/site-packages/datadog/dogshell
RUN rm -rf ./python/lib/$runtime/site-packages/bin/dog*

# remove *.dist-info directories except any entry_points.txt files and METADATA files required for Appsec Software Composition Analysis
RUN find ./python/lib/$runtime/site-packages/*.dist-info \
-type f \
Expand All @@ -50,7 +52,8 @@ RUN rm -rf \
./python/lib/$runtime/site-packages/urllib3* \
./python/lib/$runtime/site-packages/certifi* \
./python/lib/$runtime/site-packages/idna* \
./python/lib/$runtime/site-packages/charset_normalizer*
./python/lib/$runtime/site-packages/charset_normalizer* \
./python/lib/$runtime/site-packages/*__mypyc*.so # from charset_normalizer

# Precompile all .pyc files and remove .py files. This speeds up load time.
# Compile with optimization level 2 (-OO) and PYTHONNODEBUGRANGES=1 to redtce
Expand Down
Loading