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

feat(python): optimize Python layer by always building wheels #10

Merged
merged 2 commits into from
Oct 7, 2022
Merged
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
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