Skip to content
New issue

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

Add additional explanation of --mount=type=cache #10075

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/guides/integration/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -313,6 +313,10 @@ 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.

Expand Down
Loading