Skip to content

Commit 7400874

Browse files
authored
chore: update build to output directly to path (#410)
* update `Dockerfile` and `build_layers.sh` updated script to output directly on build, allowing me to run this locally and in a gitlab job * uncomment needed changes
1 parent 8879688 commit 7400874

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG image
2-
FROM $image
2+
FROM $image as builder
33

44
ARG runtime
55

@@ -23,3 +23,6 @@ RUN find . -name '*.so' -exec strip -g {} \;
2323
RUN rm -rf ./python/lib/$runtime/site-packages/botocore*
2424
RUN rm -rf ./python/lib/$runtime/site-packages/setuptools
2525
RUN rm -rf ./python/lib/$runtime/site-packages/jsonschema/tests
26+
27+
FROM scratch
28+
COPY --from=builder /build/python /

scripts/build_layers.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,8 @@ function docker_build_zip {
4949
--build-arg image=python:$1 \
5050
--build-arg runtime=python$1 \
5151
--platform linux/${arch} \
52-
--load
53-
54-
# Run the image by runtime tag and copy the output /build/python to the temp dir
55-
dockerId=$(docker create datadog-lambda-python-${arch}:$1)
56-
docker cp $dockerId:/build/python $temp_dir/python
57-
52+
--progress=plain \
53+
-o $temp_dir/python
5854

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

0 commit comments

Comments
 (0)