From 945e5f119a0609c3c3df298e35aec910eda4a225 Mon Sep 17 00:00:00 2001 From: Joey Zhao <5253430+joeyzhao2018@users.noreply.github.com> Date: Wed, 30 Aug 2023 12:54:28 -0400 Subject: [PATCH] use docker-cp when building layers --- scripts/build_layers.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build_layers.sh b/scripts/build_layers.sh index 0312ff08..976ba5d1 100755 --- a/scripts/build_layers.sh +++ b/scripts/build_layers.sh @@ -51,9 +51,9 @@ function docker_build_zip { --platform linux/${arch} \ --load - # Run the image by runtime tag, tar its generatd `python` directory to sdout, - # then extract it to a temp directory. - docker run datadog-lambda-python-${arch}:$1 tar cf - python | tar -xf - -C $temp_dir + # Run the image by runtime tag and copy the output /build/python to the temp dir + dockerId=$(docker create datadog-lambda-python-${arch}:$1) + docker cp $dockerId:/build/python $temp_dir/python # Zip to destination, and keep directory structure as based in $temp_dir