Skip to content

Commit c494f96

Browse files
authored
Use UV_LINK_MODE=copy in Dockerfile to avoid hardlink fail (#22128)
Signed-off-by: mgoin <[email protected]>
1 parent 0c275ad commit c494f96

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docker/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ RUN --mount=type=cache,target=/root/.cache/uv \
119119
# Reference: https://github.com/astral-sh/uv/pull/1694
120120
ENV UV_HTTP_TIMEOUT=500
121121
ENV UV_INDEX_STRATEGY="unsafe-best-match"
122+
# Use copy mode to avoid hardlink failures with Docker cache mounts
123+
ENV UV_LINK_MODE=copy
122124

123125
# Upgrade to GCC 10 to avoid https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92519
124126
# as it was causing spam when compiling the CUTLASS kernels
@@ -181,6 +183,8 @@ COPY requirements/build.txt requirements/build.txt
181183
# Reference: https://github.com/astral-sh/uv/pull/1694
182184
ENV UV_HTTP_TIMEOUT=500
183185
ENV UV_INDEX_STRATEGY="unsafe-best-match"
186+
# Use copy mode to avoid hardlink failures with Docker cache mounts
187+
ENV UV_LINK_MODE=copy
184188

185189
RUN --mount=type=cache,target=/root/.cache/uv \
186190
uv pip install --system -r requirements/build.txt \
@@ -272,6 +276,8 @@ ARG PYTORCH_CUDA_INDEX_BASE_URL
272276
# Reference: https://github.com/astral-sh/uv/pull/1694
273277
ENV UV_HTTP_TIMEOUT=500
274278
ENV UV_INDEX_STRATEGY="unsafe-best-match"
279+
# Use copy mode to avoid hardlink failures with Docker cache mounts
280+
ENV UV_LINK_MODE=copy
275281

276282
COPY requirements/lint.txt requirements/lint.txt
277283
COPY requirements/test.txt requirements/test.txt
@@ -341,6 +347,8 @@ RUN --mount=type=cache,target=/root/.cache/uv \
341347
# Reference: https://github.com/astral-sh/uv/pull/1694
342348
ENV UV_HTTP_TIMEOUT=500
343349
ENV UV_INDEX_STRATEGY="unsafe-best-match"
350+
# Use copy mode to avoid hardlink failures with Docker cache mounts
351+
ENV UV_LINK_MODE=copy
344352

345353
# Workaround for https://github.com/openai/triton/issues/2507 and
346354
# https://github.com/pytorch/pytorch/issues/107960 -- hopefully
@@ -472,6 +480,8 @@ ARG PIP_EXTRA_INDEX_URL UV_EXTRA_INDEX_URL
472480
# Reference: https://github.com/astral-sh/uv/pull/1694
473481
ENV UV_HTTP_TIMEOUT=500
474482
ENV UV_INDEX_STRATEGY="unsafe-best-match"
483+
# Use copy mode to avoid hardlink failures with Docker cache mounts
484+
ENV UV_LINK_MODE=copy
475485

476486
# install development dependencies (for testing)
477487
RUN --mount=type=cache,target=/root/.cache/uv \

0 commit comments

Comments
 (0)