adds docs for docker caching for managed python (#15689)

<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

Closes #15586
This commit is contained in:
Antony Kellermann 2025-09-04 11:50:22 -07:00 committed by GitHub
parent 70222e9358
commit b68161f0ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 0 deletions

View File

@ -367,6 +367,16 @@ not being able to use hard links since the cache and sync target are on separate
If you're not mounting the cache, image size can be reduced by using the `--no-cache` flag or If you're not mounting the cache, image size can be reduced by using the `--no-cache` flag or
setting `UV_NO_CACHE`. setting `UV_NO_CACHE`.
By default, managed Python installations are not cached before being installed. Setting
`UV_PYTHON_CACHE_DIR` can be used in combination with a cache mount:
```dockerfile title="Dockerfile"
ENV UV_PYTHON_CACHE_DIR=/root/.cache/uv/python
RUN --mount=type=cache,target=/root/.cache/uv \
uv python install
```
!!! note !!! note
The cache directory's location can be determined by running the `uv cache dir` command in the The cache directory's location can be determined by running the `uv cache dir` command in the