From 25773e2734758b425d5cf4cc41fc56df535c451e Mon Sep 17 00:00:00 2001 From: Matthijs Kok Date: Fri, 28 Nov 2025 16:11:05 +0100 Subject: [PATCH 1/3] Update Docker integration guide to prefer COPY over ADD for simple cases --- docs/guides/integration/docker.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/guides/integration/docker.md b/docs/guides/integration/docker.md index 5e97c1bc2593e..1ce43daedd2c0 100644 --- a/docs/guides/integration/docker.md +++ b/docs/guides/integration/docker.md @@ -162,11 +162,13 @@ ADD https://astral.sh/uv/0.9.13/install.sh /uv-installer.sh If you're using uv to manage your project, you can copy it into the image and install it: ```dockerfile title="Dockerfile" +# Change the working directory to the `app` directory +WORKDIR /app + # Copy the project into the image -ADD . /app +COPY . . # Sync the project into a new environment, asserting the lockfile is up to date -WORKDIR /app RUN uv sync --locked ``` @@ -412,7 +414,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ uv sync --locked --no-install-project # Copy the project into the image -ADD . /app +COPY . . # Sync the project RUN --mount=type=cache,target=/root/.cache/uv \ @@ -447,7 +449,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ uv sync --frozen --no-install-workspace -ADD . /app +COPY . . RUN --mount=type=cache,target=/root/.cache/uv \ uv sync --locked @@ -487,7 +489,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ uv sync --locked --no-install-project --no-editable # Copy the project into the intermediate image -ADD . /app +COPY . . # Sync the project RUN --mount=type=cache,target=/root/.cache/uv \ From c7a00111866e40051f17bad079bd55580f4254ee Mon Sep 17 00:00:00 2001 From: Matthijs Kok Date: Wed, 3 Dec 2025 15:55:27 +0100 Subject: [PATCH 2/3] Implement suggestion --- docs/guides/integration/docker.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/guides/integration/docker.md b/docs/guides/integration/docker.md index 1ce43daedd2c0..67b9671562ac9 100644 --- a/docs/guides/integration/docker.md +++ b/docs/guides/integration/docker.md @@ -166,7 +166,7 @@ If you're using uv to manage your project, you can copy it into the image and in WORKDIR /app # Copy the project into the image -COPY . . +COPY . /app # Sync the project into a new environment, asserting the lockfile is up to date RUN uv sync --locked @@ -414,7 +414,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ uv sync --locked --no-install-project # Copy the project into the image -COPY . . +COPY . /app # Sync the project RUN --mount=type=cache,target=/root/.cache/uv \ @@ -449,7 +449,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ uv sync --frozen --no-install-workspace -COPY . . +COPY . /app RUN --mount=type=cache,target=/root/.cache/uv \ uv sync --locked @@ -489,7 +489,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ uv sync --locked --no-install-project --no-editable # Copy the project into the intermediate image -COPY . . +COPY . /app # Sync the project RUN --mount=type=cache,target=/root/.cache/uv \ From 2cb11e049a8fa9619669f43960f9c978168cf76c Mon Sep 17 00:00:00 2001 From: Matthijs Kok Date: Wed, 3 Dec 2025 16:02:25 +0100 Subject: [PATCH 3/3] Implement suggestion 2 --- docs/guides/integration/docker.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/guides/integration/docker.md b/docs/guides/integration/docker.md index 67b9671562ac9..10e815900a84f 100644 --- a/docs/guides/integration/docker.md +++ b/docs/guides/integration/docker.md @@ -162,13 +162,11 @@ ADD https://astral.sh/uv/0.9.13/install.sh /uv-installer.sh If you're using uv to manage your project, you can copy it into the image and install it: ```dockerfile title="Dockerfile" -# Change the working directory to the `app` directory -WORKDIR /app - # Copy the project into the image COPY . /app # Sync the project into a new environment, asserting the lockfile is up to date +WORKDIR /app RUN uv sync --locked ```