mirror of https://github.com/astral-sh/uv
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:
parent
70222e9358
commit
b68161f0ca
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue