Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit f9b3290

Browse files
feat(python): optimize Python layer by always building wheels (#10)
Co-authored-by: Heitor Lessa <[email protected]>
1 parent 6686a0b commit f9b3290

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

layer/Python/Dockerfile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,24 @@ WORKDIR /tmp
1212

1313
RUN yum update -y && yum install -y zip unzip wget tar gzip binutils
1414

15-
RUN pip install -t /asset/python aws-lambda-powertools$PACKAGE_SUFFIX
15+
# Install build essentials
16+
RUN yum install -y \
17+
boost-devel \
18+
jemalloc-devel \
19+
bison \
20+
make \
21+
gcc \
22+
gcc-c++ \
23+
flex \
24+
autoconf \
25+
zip \
26+
git \
27+
ninja-build
28+
29+
# Install cython to generate native code
30+
RUN pip install --upgrade pip wheel && pip install --upgrade cython
31+
# Optimize binary size and strip debugging symbols for optimum size
32+
RUN CFLAGS="-Os -g0 -s" pip install --no-binary pydantic -t /asset/python aws-lambda-powertools$PACKAGE_SUFFIX
1633

1734
# Removing nonessential files
1835
RUN cd /asset && \

0 commit comments

Comments
 (0)