Skip to content

Commit

Permalink
Add UV_LINK_MODE to Docker caching example
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Sep 18, 2024
1 parent fe4e39a commit 6371c9b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/guides/integration/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,15 @@ A [cache mount](https://docs.docker.com/build/guide/mounts/#add-a-cache-mount) c
improve performance across builds:

```dockerfile title="Dockerfile"
ENV UV_LINK_MODE=copy
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync
```

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.

If you're not mounting the cache, image size can be reduced by using the `--no-cache` flag or
setting `UV_NO_CACHE`.

Expand Down

0 comments on commit 6371c9b

Please sign in to comment.