chroma-core / chroma

the AI-native open-source embedding database
https://www.trychroma.com/
Apache License 2.0
15.52k stars 1.3k forks source link

[Install issue]: Run with Environment Variables #3151

Open scythetrigger opened 5 days ago

scythetrigger commented 5 days ago

What happened?

I've tried many combinations of environment variables, but I still can't get chromadb to run in my docker container. Note: chroma runs fine if I do "chroma run --host 0.0.0.0 --port 8000

Versions

chromadb==0.5.18, python v3.12, ubi9.4

Relevant log output

ENTRYPOINT ["chroma", "run"]
docker run -d -p 8000:8000 \
-e CHROMA_INTEGRATION_TEST_ONLY=1 \
-e CHROMA_API_IMPL=chromadb.api.fastapi.FastAPI \
-e CHROMA_SERVER_HOST=localhost \
-e CHROMA_SERVER_HTTP_PORT=8000 \
-e CHROMA_SERVER_NOFILE=65535 \
--add-host=localhost:host-gateway \
-v chroma:/app/.chroma \
--name chroma \
--restart always chroma
[Errno 99] error while attempting to bind on address ('192.168.65.254', 8000): cannot assign requested address

-e CHROMA_API_IMPL=rest \
-e CHROMA_SERVER_HOST=0.0.0.0 \
-e CHROMA_SERVER_HTTP_PORT=8000 \
-e CHROMA_SERVER_AUTHN_PROVIDER=chromadb.auth.token_authn.TokenAuthenticationServerProvider \
-e CHROMA_AUTH_TOKEN_TRANSPORT_HEADER= \
-e CHROMA_SERVER_AUTHN_CREDENTIALS= \
-e CHROMA_CLIENT_AUTH_PROVIDER=chromadb.auth.token_authn.TokenAuthClientProvider \
-e CHROMA_AUTH_TOKEN_TRANSPORT_HEADER= \
-e CHROMA_CLIENT_AUTH_CREDENTIALS= \
tazarov commented 2 days ago

@scythetrigger, I think the issue is the --add-host=localhost:host-gateway. What this tells docker is to do a dns mapping for localhost to the gateway IP which in your case is 192.168.65.254. Given that the the gateway IP is not owned by the container and its interfaces the failure to bind is kind of expected.

Another protip here remove -e CHROMA_API_IMPL=rest as this will also cause a failure, the option is no longer supported in Chroma.