1

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
1
  • What Linux distro do you use? Commented Aug 21, 2024 at 6:33

1 Answer 1

1
+50

i got this from this thread in playwright github bug report

you are trying to run playwright in linux distro which is not supported by playwright.

you need to check the system requirement section of playwright supported linux distro by playwright

the version of distro you are trying to use is amazon linux 2 which is not supported by playwright

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.