WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager

Viewed 2287

I get this Warning message in Docker image Build stage. Is there anyway to supress this warning ? i want to keep using root though.

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

My Dockerfile :

FROM python:3.8.11-slim-buster
ENV PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    POETRY_VERSION=1.1.13

RUN python3 -m pip install poetry==$POETRY_VERSION

COPY poetry.lock pyproject.toml ./
RUN poetry config virtualenvs.create false \
    && poetry install --no-interaction --no-dev --no-ansi
1 Answers
Related