We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--system
uv sync
I have the current Dockerfile
FROM python:3.12-slim ENV PYTHONUNBUFFERED=1 RUN apt-get update && \ apt-get install -y git libgomp1 && \ rm -rf /var/lib/apt/lists/* ARG CODE=/app WORKDIR $CODE COPY pyproject.toml uv.lock ./ RUN --mount=from=ghcr.io/astral-sh/uv,source=/uv,target=/bin/uv \ uv sync --frozen --no-cache --compile-bytecode --no-dev COPY src/ src/ CMD [".venv/bin/python", "-m", "src.api_sample"]
I would like to install the dependencies using the system Python so that the final command is CMD ["python", "-m", "src.api_sample"]
CMD ["python", "-m", "src.api_sample"]
I tried using uv pip install -r pyproject.toml --system but this approach does not use the uv.lock file
uv pip install -r pyproject.toml --system
uv.lock
The text was updated successfully, but these errors were encountered:
To force uv to use the system Python, provide the --python-preference only-system option.
--python-preference only-system
Maybe consider this?
Ref: https://docs.astral.sh/uv/concepts/python-versions/#adjusting-python-version-preferences
Sorry, something went wrong.
Please see https://docs.astral.sh/uv/guides/integration/docker/#using-the-environment and https://docs.astral.sh/uv/concepts/projects/#configuring-the-project-environment-path
This use-case should be resolved by #6834
No branches or pull requests
I have the current Dockerfile
I would like to install the dependencies using the system Python so that the final command is
CMD ["python", "-m", "src.api_sample"]
I tried using
uv pip install -r pyproject.toml --system
but this approach does not use theuv.lock
fileThe text was updated successfully, but these errors were encountered: