Skip to content

Dockerfile: broad COPY --from=python-base /usr/local /usr/local may overwrite tools or add bloat #548

@gkorland

Description

@gkorland

Description

In Dockerfile:14, the entire /usr/local directory tree is copied from the Python base image:

COPY --from=python-base /usr/local /usr/local

This potentially overwrites existing tools in the FalkorDB base image and adds unnecessary files (man pages, docs, other system-installed tools from the Python image).

Suggested Fix

Copy only the Python installation directories that are actually needed:

COPY --from=python-base /usr/local/bin/python* /usr/local/bin/
COPY --from=python-base /usr/local/lib/python3.12 /usr/local/lib/python3.12
COPY --from=python-base /usr/local/include/python3.12 /usr/local/include/python3.12
COPY --from=python-base /usr/local/lib/libpython3.12* /usr/local/lib/

Or use a more targeted approach to identify exactly which paths are needed.

Context

Found during code review of PR #522.

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