Skip to content

Missing find command in lambda/python:3.12 image #196

Open
@tlinhart

Description

@tlinhart

I'm trying to decrease my Docker image size by cleaning the cache files after installing the requirements but the build fails due to a missing find command. This is my Dockerfile:

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

COPY requirements.txt /tmp
RUN pip install -t ${LAMBDA_TASK_ROOT} -r /tmp/requirements.txt \
 && find ${LAMBDA_TASK_ROOT} -regex '^.*\(__pycache__\|\.py[co]\)$' -delete

COPY lambda_function.py ${LAMBDA_TASK_ROOT}

CMD ["lambda_function.lambda_handler"]

Looking inside the running container, it seems that other usual files are present in /usr/bin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions