From f8ecaeb5b9b59592e82d0fbe00c0276f6773d67a Mon Sep 17 00:00:00 2001 From: Lucas Pimentel Date: Tue, 25 Aug 2026 11:26:43 -0400 Subject: [PATCH 1/3] fix: update pprof prebuild cleanup for @datadog/pprof 5.14.4 The @datadog/pprof package restructured its prebuilds in 5.14.4, breaking the Dockerfile cleanup that removes unused platform/ABI binaries from the Lambda layer: 1. Platform directories renamed: linuxglibc-x64 -> linux-x64, linuxglibc-arm64 -> linux-arm64. The old linuxmusl-* dirs no longer exist as separate dirs; musl .node files now live alongside glibc inside linux-x64/ and linux-arm64/. 2. File naming changed: node-111.node -> dd_pprof.node.abi111.node, so the old glob patterns matched nothing. This caused 36 files (8.6 MB) of unnecessary prebuilds to ship in the layer instead of 8 files (2.1 MB). The fix updates the cleanup to use the new directory/file naming and removes musl binaries via glob, bringing the layer down to 6 files (1.8 MB). --- Dockerfile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6a80aa58..8af8b4fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,17 +53,21 @@ RUN rm -rf /nodejs/node_modules/aws-xray-sdk-core/node_modules/aws-sdk # Remove heavy files from @datadog/pprof which aren't used in a lambda environment # TODO: Ship individual bindings per platform and depend on that instead. # TODO: Split x64 and ARM so that each image only has the binaries for its architecture. +# Lambda runs on Amazon Linux 2 (glibc), on x64 or arm64. +# Remove non-Linux platform prebuilds RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/darwin-arm64 RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/darwin-x64 -RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/linux-arm -RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/linuxmusl-arm64 -RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/linuxmusl-x64 -RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/win32-ia32 RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/win32-x64 -RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/node-111.node -RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/node-120.node -RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/node-131.node -RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/node-141.node +# Remove musl prebuilds (Lambda uses glibc, not musl) +RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.musl.node.*.node +# Remove ABIs for non-LTS Node versions not supported on Lambda +# Lambda supports Node 18 (abi108), Node 20 (abi115), Node 22 (abi127) +RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi111.node +RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi120.node +RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi131.node +RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi137.node +RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi141.node +RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi147.node # Remove unused @datadog/native-appsec prebuilds for non-Lambda platforms. # Lambda runs on Amazon Linux 2 (glibc), on x64 or arm64. From a9e6831850ecffb8ebe9511f2c309ceb7c5a79e8 Mon Sep 17 00:00:00 2001 From: Lucas Pimentel Date: Tue, 25 Aug 2026 11:37:41 -0400 Subject: [PATCH 2/3] fix comment Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8af8b4fb..35d74a18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,7 +53,7 @@ RUN rm -rf /nodejs/node_modules/aws-xray-sdk-core/node_modules/aws-sdk # Remove heavy files from @datadog/pprof which aren't used in a lambda environment # TODO: Ship individual bindings per platform and depend on that instead. # TODO: Split x64 and ARM so that each image only has the binaries for its architecture. -# Lambda runs on Amazon Linux 2 (glibc), on x64 or arm64. +# Lambda's supported Node.js runtimes use glibc on x64 or arm64. # Remove non-Linux platform prebuilds RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/darwin-arm64 RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/darwin-x64 From 1ec755e344754c54ad6ed53619c83b57c49e8c6a Mon Sep 17 00:00:00 2001 From: Lucas Pimentel Date: Tue, 25 Aug 2026 11:38:29 -0400 Subject: [PATCH 3/3] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 35d74a18..868ad47a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,13 +61,11 @@ RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/win32-x64 # Remove musl prebuilds (Lambda uses glibc, not musl) RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.musl.node.*.node # Remove ABIs for non-LTS Node versions not supported on Lambda -# Lambda supports Node 18 (abi108), Node 20 (abi115), Node 22 (abi127) +# Lambda supports Node 18 (abi108), Node 20 (abi115), Node 22 (abi127), Node 24 (abi137), and Node 26 (abi147) RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi111.node RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi120.node RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi131.node -RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi137.node RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi141.node -RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi147.node # Remove unused @datadog/native-appsec prebuilds for non-Lambda platforms. # Lambda runs on Amazon Linux 2 (glibc), on x64 or arm64.