Where are Python libraries installed on Docker container from AWS Lambda Python image?

  aws-lambda, docker, python-3.x

I’m trying to deploy a lambda function using a Docker image, but I want to modify some of the code in the Python packages I’m installing. I can’t find where the packages are installed for me to modify the source code.

My Dockerfile is as follows:

FROM public.ecr.aws/lambda/python:3.8

WORKDIR /usr/src/project

COPY lambda_handler.py ${LAMBDA_TASK_ROOT}

COPY requirements.txt ./

RUN pip install --no-cache-dir --upgrade pip && 
    pip install --no-cache-dir -r requirements.txt

CMD [ "lambda_handler.lambda_handler" ]

Question: Where are the packages from the requirements.txt file installed? I tried going into the container but it doesn’t give me the bash terminal because the container is made from a Lambda image, which requires the entry point to be the lambda handler.

Source: Docker Questions

LEAVE A COMMENT