Skip to content

Conversation

@yashwantbezawada
Copy link

Summary

Fixes the Dockerfile to ensure chromadb is installed from the locally-built wheel instead of potentially downloading from PyPI.

Problem

The current Dockerfile uses --find-links target/wheels/ which only provides a preference hint to pip. Despite this flag, pip can still download chromadb from the public PyPI repository instead of using the locally-built wheel.

Current problematic line (Line 52):

RUN pip install --prefix="/install" --find-links target/wheels/ --upgrade chromadb

Solution

Changed to directly specify the local wheel file path:

RUN pip install --prefix="/install" target/wheels/chromadb*.whl

This explicitly installs from the locally-built wheel files, eliminating ambiguity and ensuring the Docker build uses the local code.

Impact

  • ✅ Ensures Docker builds use locally-built chromadb wheel
  • ✅ Prevents unintended downloads from PyPI
  • ✅ Makes build process more predictable and reliable
  • ✅ Aligns with the intended build workflow

Testing

The fix follows standard Docker/pip best practices for installing from local wheel files. The wildcard pattern chromadb*.whl will match the wheel built by maturin build in the previous step.

Fixes #5835

Changes pip install to use direct wheel path (target/wheels/chromadb*.whl)
instead of --find-links flag which only provides a preference hint.

Previously, despite --find-links suggesting the local directory, pip could
still download chromadb from PyPI. This ensures the locally-built wheel
is always used during Docker image builds.

Fixes chroma-core#5835
@github-actions
Copy link

github-actions bot commented Nov 9, 2025

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@propel-code-bot
Copy link
Contributor

Ensure Docker installs local chromadb wheel

Replaces the pip install command in the Dockerfile to reference the locally-built wheel (target/wheels/chromadb*.whl) instead of relying on the --find-links preference hint. This guarantees that the Docker image always uses the source checked out in the build context rather than downloading chromadb from PyPI.

Key Changes

• Deleted RUN pip install --prefix="/install" --find-links target/wheels/ --upgrade chromadb
• Added RUN pip install --prefix="/install" target/wheels/chromadb*.whl

Affected Areas

Dockerfile
• Image build pipeline (Python package installation)

This summary was automatically generated by @propel-code-bot

RUN python3 -m maturin build
RUN pip uninstall chromadb -y
RUN pip install --prefix="/install" --find-links target/wheels/ --upgrade chromadb
RUN pip install --prefix="/install" target/wheels/chromadb*.whl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[BestPractice]

The wildcard pattern target/wheels/chromadb*.whl could fail if multiple wheel files exist or no wheel files are found. If maturin build produces multiple wheels (e.g., for different Python versions) or fails to create any wheels, this command will either install the wrong version or fail entirely.

Consider being more explicit:

RUN pip install --prefix="/install" target/wheels/chromadb-*.whl

Or add error handling:

RUN pip install --prefix="/install" target/wheels/chromadb*.whl || (echo "No chromadb wheel found in target/wheels/" && exit 1)
Context for Agents
[**BestPractice**]

The wildcard pattern `target/wheels/chromadb*.whl` could fail if multiple wheel files exist or no wheel files are found. If `maturin build` produces multiple wheels (e.g., for different Python versions) or fails to create any wheels, this command will either install the wrong version or fail entirely.

Consider being more explicit:
```dockerfile
RUN pip install --prefix="/install" target/wheels/chromadb-*.whl
```

Or add error handling:
```dockerfile
RUN pip install --prefix="/install" target/wheels/chromadb*.whl || (echo "No chromadb wheel found in target/wheels/" && exit 1)
```

File: Dockerfile
Line: 52

@sanketkedia sanketkedia requested a review from jairad26 November 13, 2025 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Dockerfile for building chroma installs chromadb from pip instead of the build

1 participant