Skip to content

'Invalid cross-device link (os error 18)' during 'ruff' installation in Docker container #11163

Closed
@heso

Description

@heso

Problem:

When trying to install dependencies mentioned in the dependencies section (only ruff at the moment) using:

docker-compose build
docker-compose run --rm test_app uv sync -v

I get the following error:

error: Failed to install: ruff-0.1.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (ruff==0.1.15)
  Caused by: failed to rename file from /usr/local/lib/python3.11/site-packages/ruff-0.1.15.data/scripts/ruff to /usr/local/bin/ruff: Invalid cross-device link (os error 18)

Configuration:

Dockerfile:

FROM docker-proxy.kontur.host/python:3.11-slim

ENV UV_LINK_MODE=copy
ENV UV_PROJECT_ENVIRONMENT=/usr/local
ENV UV_SYSTEM_PYTHON=1

RUN pip install uv~=0.5.26

compose.yml

services:
  test_app:
    build:
      context: .
    working_dir:  /opt/test
    volumes:
      - site_packages:/usr/local/lib/python3.11/site-packages
      - usr_local_bin:/usr/local/bin
      - uv_cache:/root/.cache/uv
      - ./src:/opt/test

volumes:
  site_packages:
  usr_local_bin:
  uv_cache:

pyproject.toml:

[project]
name = "example-app"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
    "ruff~=0.1.14",
]

structure:

project/
├── compose.yml
├── Dockerfile
└── src/
    ├── main.py
    ├── pyproject.toml
    └── uv.lock

Platform

Linux 5.15.153.1-microsoft-standard-WSL2 x86_64 GNU/Linux

Version

uv 0.5.26

Python version

Python 3.11.11

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions