diff --git a/Dockerfile b/Dockerfile index 757d0c00..396ef25c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,18 +14,18 @@ RUN pip install . -t ./python/lib/$runtime/site-packages # Remove *.pyc files RUN find ./python/lib/$runtime/site-packages -name \*.pyc -delete -# Strip symbols from ddtrace's binaries. -# TODO (AJ): remove when ddtrace fixes this upstream -RUN find . -name '*.so' -exec strip -g {} \; - # Remove botocore (40MB) to reduce package size. aws-xray-sdk # installs it, while it's already provided by the Lambda Runtime. 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 find . -name 'libddwaf.so' -delete +RUN rm -rf ./python/lib/$runtime/site-packages/urllib3 RUN rm ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_taint_tracking/*.so 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 FROM scratch COPY --from=builder /build/python / diff --git a/scripts/check_layer_size.sh b/scripts/check_layer_size.sh index 9dbd7e99..84752fa1 100755 --- a/scripts/check_layer_size.sh +++ b/scripts/check_layer_size.sh @@ -9,8 +9,8 @@ # 7 mb size limit set -e -MAX_LAYER_COMPRESSED_SIZE_KB=$(expr 7 \* 1024) -MAX_LAYER_UNCOMPRESSED_SIZE_KB=$(expr 24 \* 1024) +MAX_LAYER_COMPRESSED_SIZE_KB=$(expr 4 \* 1024) +MAX_LAYER_UNCOMPRESSED_SIZE_KB=$(expr 13 \* 1024) LAYER_FILES_PREFIX="datadog_lambda_py"