Skip to content

Commit

Permalink
feat(python): optimize Python layer by always building wheels (#10)
Browse files Browse the repository at this point in the history
Co-authored-by: Heitor Lessa <[email protected]>
  • Loading branch information
rubenfonseca and heitorlessa authored Oct 7, 2022
1 parent 6686a0b commit f9b3290
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion layer/Python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,24 @@ WORKDIR /tmp

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

RUN pip install -t /asset/python aws-lambda-powertools$PACKAGE_SUFFIX
# Install build essentials
RUN yum install -y \
boost-devel \
jemalloc-devel \
bison \
make \
gcc \
gcc-c++ \
flex \
autoconf \
zip \
git \
ninja-build

# Install cython to generate native code
RUN pip install --upgrade pip wheel && pip install --upgrade cython
# Optimize binary size and strip debugging symbols for optimum size
RUN CFLAGS="-Os -g0 -s" pip install --no-binary pydantic -t /asset/python aws-lambda-powertools$PACKAGE_SUFFIX

# Removing nonessential files
RUN cd /asset && \
Expand Down

0 comments on commit f9b3290

Please sign in to comment.