Skip to content

chore: update build to output directly to path #410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG image
FROM $image
FROM $image as builder

ARG runtime

Expand All @@ -23,3 +23,6 @@ RUN find . -name '*.so' -exec strip -g {} \;
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

FROM scratch
COPY --from=builder /build/python /
8 changes: 2 additions & 6 deletions scripts/build_layers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,8 @@ function docker_build_zip {
--build-arg image=python:$1 \
--build-arg runtime=python$1 \
--platform linux/${arch} \
--load

# 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

--progress=plain \
-o $temp_dir/python

# Zip to destination, and keep directory structure as based in $temp_dir
(cd $temp_dir && zip -q -r $destination ./)
Expand Down