From a28e84f947d1c54e7ffbdb410110a79ea4859268 Mon Sep 17 00:00:00 2001 From: Mike Roberts Date: Sat, 21 Dec 2024 12:10:20 +0000 Subject: [PATCH 1/3] Add additional explanation of --mount=type=cache --- docs/guides/integration/docker.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/guides/integration/docker.md b/docs/guides/integration/docker.md index ee1ae752186f..3ce1bf41a10e 100644 --- a/docs/guides/integration/docker.md +++ b/docs/guides/integration/docker.md @@ -313,6 +313,11 @@ RUN --mount=type=cache,target=/root/.cache/uv \ uv sync ``` +This will reuse downloaded packages across builds on the same machine, reducing the time taken to +install dependencies. +The cache is only mounted for the duration of the `uv sync` command and is not included in the final +image, minimising the image size. + Changing the default [`UV_LINK_MODE`](../../reference/settings.md#link-mode) silences warnings about not being able to use hard links since the cache and sync target are on separate file systems. From 04b41fb1242f4deeac9f08eb1219e12d38c65bac Mon Sep 17 00:00:00 2001 From: Mike Roberts Date: Sat, 21 Dec 2024 12:17:56 +0000 Subject: [PATCH 2/3] fix broken link to docker docs --- docs/guides/integration/docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/integration/docker.md b/docs/guides/integration/docker.md index 3ce1bf41a10e..e8003757dccf 100644 --- a/docs/guides/integration/docker.md +++ b/docs/guides/integration/docker.md @@ -303,7 +303,7 @@ ENV UV_COMPILE_BYTECODE=1 ### Caching -A [cache mount](https://docs.docker.com/build/guide/mounts/#add-a-cache-mount) can be used to +A [cache mount](https://docs.docker.com/build/cache/optimize/#use-cache-mounts) can be used to improve performance across builds: ```dockerfile title="Dockerfile" From e7a7d475bb60f5ecda2484c976f6cd4695877a68 Mon Sep 17 00:00:00 2001 From: Mike Roberts Date: Sat, 21 Dec 2024 12:24:26 +0000 Subject: [PATCH 3/3] fix prettier --- docs/guides/integration/docker.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/guides/integration/docker.md b/docs/guides/integration/docker.md index e8003757dccf..15aca0c75cdb 100644 --- a/docs/guides/integration/docker.md +++ b/docs/guides/integration/docker.md @@ -314,9 +314,8 @@ RUN --mount=type=cache,target=/root/.cache/uv \ ``` This will reuse downloaded packages across builds on the same machine, reducing the time taken to -install dependencies. -The cache is only mounted for the duration of the `uv sync` command and is not included in the final -image, minimising the image size. +install dependencies. The cache is only mounted for the duration of the `uv sync` command and is not +included in the final image, minimising the image size. Changing the default [`UV_LINK_MODE`](../../reference/settings.md#link-mode) silences warnings about not being able to use hard links since the cache and sync target are on separate file systems.