Dockerfile:
FROM python:3.10-slim
ENV PYTHONUNBUFFERED 1
WORKDIR /app
COPY ./requirements.txt .
RUN pip install --trusted-host mirrors.aliyun.com --no-cache-dir --upgrade -r requirements.txt
Error during build:
Attempting uninstall: setuptools
Found existing installation: setuptools 65.5.0
Uninstalling setuptools-65.5.0:
ERROR: Could not install packages due to an OSError: [Errno 39] Directory not empty: '/usr/local/lib/python3.10/site-packages/_distutils_hack/'
It seems a permission error while deleting a folder. As root is the default user in Docker, I don't understand why lack of permission.