Skip to content

Commit

Permalink
try node built-in cache instead
Browse files Browse the repository at this point in the history
  • Loading branch information
rochdev committed Jan 17, 2025
1 parent eb2bd8b commit 76f7e22
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,9 @@ RUN find /nodejs/node_modules -name "*.md" -delete
# Warm up v8 compile cache
RUN node -e "require('/nodejs/node_modules/datadog-lambda-js/runtime/module_importer').initTracer()"

# Remove leftover temp files
RUN rm -rf /tmp/yarn-*

FROM scratch
COPY --from=builder /nodejs /
COPY --from=builder /nodejs /nodejs
COPY --from=builder /tmp /tmp
2 changes: 1 addition & 1 deletion scripts/build_layers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function docker_build_zip {
# between different node runtimes.
temp_dir=$(mktemp -d)
docker buildx build -t datadog-lambda-layer-node:$1 . --no-cache \
--build-arg image=registry.ddbuild.io/images/mirror/node:${node_image_version}-bullseye --progress=plain -o $temp_dir/nodejs
--build-arg image=registry.ddbuild.io/images/mirror/node:${node_image_version}-bullseye --progress=plain -o $temp_dir

# Zip to destination, and keep directory structure as based in $temp_dir
(cd $temp_dir && zip -q -r $destination ./)
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/module_importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exports.import = function (path) {
}

exports.initTracer = function () {
compileCache()
// compileCache()

// Looks for the function local version of dd-trace first, before using
// the version provided by the layer
Expand Down

0 comments on commit 76f7e22

Please sign in to comment.