Skip to content

Commit

Permalink
Add UV_LINK_MODE to Docker caching example (#7510)
Browse files Browse the repository at this point in the history
As mentioned in #7509
  • Loading branch information
zanieb authored Sep 19, 2024
1 parent 7778a11 commit 209c870
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 209c870

Please sign in to comment.