fix(docker): install uv system-wide so runtime works under non-root #981
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Install uv to /usr/local/bin in both builder and runtime stages (via UV_INSTALL_DIR=/usr/local/bin, UV_NO_MODIFY_PATH=1) so the final image’s USER app can execute
uv
without relying on /root/.local/bin. This removes the permission/path mismatch that caused “exec: 'uv': not found” at startup, while preserving BuildKit cache mounts for fastuv build
/uv sync
. The image still installs the graphiti-core wheel first, sets PATH to include /app/.venv/bin, and runsuv run uvicorn
on port 8000 for a clean, reproducible launch in Compose/Portainer.Summary
Install uv system-wide in both stages and keep a non-root runtime so
uv
is resolvable at container start, eliminating the /root traversal issue while retaining BuildKit caching and the existing multi-stage layout.Type of Change
Objective
Make the runtime image consistent with a non-root user by placing
uv
in a world-accessible system path, ensuring the final CMD [uv run uvicorn ...
] succeeds without altering runtime user or app startup behavior.Testing
Manual verification steps:
DOCKER_BUILDKIT=1 docker build -t graphiti:latest .
docker run --rm graphiti:latest sh -lc 'id; command -v uv; uv --version'
docker run --rm -p 8001:8000 graphiti:latest
and curlhttp://localhost:8001/healthcheck
Breaking Changes
If this is a breaking change, describe:
Checklist
make lint
passes)Related Issues
Closes #[issue number]