Skip to content

fix(docker): set UV_PYTHON_INSTALL_DIR to avoid permission denied#468

Open
devag7 wants to merge 2 commits into
stickerdaniel:mainfrom
devag7:fix/321-docker-venv-permission
Open

fix(docker): set UV_PYTHON_INSTALL_DIR to avoid permission denied#468
devag7 wants to merge 2 commits into
stickerdaniel:mainfrom
devag7:fix/321-docker-venv-permission

Conversation

@devag7
Copy link
Copy Markdown

@devag7 devag7 commented May 26, 2026

Fixes #321. Sets UV_PYTHON_INSTALL_DIR during docker build to prevent uv from using root-owned symlinks, allowing pwuser to run python.

Copilot AI review requested due to automatic review settings May 26, 2026 20:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates the Docker build to persist uv-managed Python installations across stages by setting a custom uv Python install directory and copying it into the runtime image.

Changes:

  • Set UV_PYTHON_INSTALL_DIR=/opt/uv-python in the builder stage before uv sync.
  • Copy /opt/uv-python from the builder stage into the runtime stage.
  • Set UV_PYTHON_INSTALL_DIR in the runtime stage for consistency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Dockerfile Outdated

WORKDIR /app
COPY pyproject.toml uv.lock README.md ./
ENV UV_PYTHON_INSTALL_DIR=/opt/uv-python
Comment thread Dockerfile Outdated
Comment on lines +23 to +24
COPY --from=builder /opt/uv-python /opt/uv-python
ENV UV_PYTHON_INSTALL_DIR=/opt/uv-python
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 26, 2026

Greptile Summary

This PR updates the Docker build so uv-managed Python is installed outside root-only paths. It changes:

  • Adds a shared UV_PYTHON_INSTALL_DIR build argument.
  • Configures uv sync to install managed Python under /opt/uv-python.
  • Copies that managed Python directory into the runtime image.
  • Keeps the runtime virtualenv and pwuser entrypoint flow intact.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Reviews (2): Last reviewed commit: "fix(docker): define single ARG for UV_PY..." | Re-trigger Greptile

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.

Docker: uv fails with Permission denied canonicalizing /app/.venv/bin/python3 (venv symlink points to /root)

2 participants