I am trying to create a Docker image that runs a Python script using Playwright on AWS Lambda. I started with the official AWS Lambda Python 3.8 image and added Playwright, but I am encountering GLIBC version issues.
Here's my Dockerfile:
# Start from AWS Python 3.8 base image
FROM public.ecr.aws/lambda/python:3.8
ENV PIP_ROOT_USER_ACTION=ignore
# Install the dependencies
COPY requirements.txt .
RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}"
RUN pip3 install playwright==1.45.0 && playwright install --with-deps --target "${LAMBDA_TASK_ROOT}"
# Copy our function code
COPY handler.py ${LAMBDA_TASK_ROOT}
COPY new.py ${LAMBDA_TASK_ROOT}
# Set the handler function
CMD [ "handler.main" ]
39.69 /var/lang/lib/python3.8/site-packages/playwright/driver/node: /lib64/libm.so.6: version GLIBC_2.27' not found (required by /var/lang/lib/python3.8/site-packages/playwright/driver/node)
39.69 /var/lang/lib/python3.8/site-packages/playwright/driver/node: /lib64/libc.so.6: version GLIBC_2.28' not found (required by /var/lang/lib/python3.8/site-packages/playwright/driver/node)
------
Dockerfile:9