1

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
Antulii
  • 55
  • 1
  • 9
  • 1
    this https://stackoverflow.com/questions/68673221/warning-running-pip-as-the-root-user recommends with a user, is it not possible to simply supress the warning and continue using root ? pip version used is 21.2.4 – Antulii Jul 28 '22 at 14:47

1 Answers1

0

As is discussed on the github, see the following links, I don't claim to be an expert on pip but this information was extremely helpful when I had something similar to this.

See pfmoore's comment on May 28, 2021

See multiple comments below

recommend looking at comments made by hholst80, pradyunsg, and potiuk on Oct 8, 2021

or as suggested by fnymnx:

Check out this StackOverflow question as well

Xeltoid
  • 88
  • 8