Update Docker integration guide to prefer `COPY` over `ADD` for simple cases (#16883)

## Summary

Docker best practices recommend to use `COPY` when the additional
functionality of `ADD` is not used.

See:
- https://docs.docker.com/build/building/best-practices/#add-or-copy
-
https://www.docker.com/blog/docker-best-practices-understanding-the-differences-between-add-and-copy-instructions-in-dockerfiles/

## Test Plan

Docs only change
This commit is contained in:
Matthijs Kok 2025-12-03 16:16:42 +01:00 committed by GitHub
parent 99660a8574
commit 539b7368cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -163,7 +163,7 @@ If you're using uv to manage your project, you can copy it into the image and in
```dockerfile title="Dockerfile" ```dockerfile title="Dockerfile"
# Copy the project into the image # Copy the project into the image
ADD . /app COPY . /app
# Sync the project into a new environment, asserting the lockfile is up to date # Sync the project into a new environment, asserting the lockfile is up to date
WORKDIR /app WORKDIR /app
@ -412,7 +412,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked --no-install-project uv sync --locked --no-install-project
# Copy the project into the image # Copy the project into the image
ADD . /app COPY . /app
# Sync the project # Sync the project
RUN --mount=type=cache,target=/root/.cache/uv \ RUN --mount=type=cache,target=/root/.cache/uv \
@ -447,7 +447,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-install-workspace uv sync --frozen --no-install-workspace
ADD . /app COPY . /app
RUN --mount=type=cache,target=/root/.cache/uv \ RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked uv sync --locked
@ -487,7 +487,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked --no-install-project --no-editable uv sync --locked --no-install-project --no-editable
# Copy the project into the intermediate image # Copy the project into the intermediate image
ADD . /app COPY . /app
# Sync the project # Sync the project
RUN --mount=type=cache,target=/root/.cache/uv \ RUN --mount=type=cache,target=/root/.cache/uv \