From b68161f0ca90c74d7a66a0f56c871abd4f45d55b Mon Sep 17 00:00:00 2001 From: Antony Kellermann Date: Thu, 4 Sep 2025 11:50:22 -0700 Subject: [PATCH] adds docs for docker caching for managed python (#15689) ## Summary Closes #15586 --- docs/guides/integration/docker.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/guides/integration/docker.md b/docs/guides/integration/docker.md index 258edee64..21ee2402c 100644 --- a/docs/guides/integration/docker.md +++ b/docs/guides/integration/docker.md @@ -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 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 The cache directory's location can be determined by running the `uv cache dir` command in the