title: WARNING: Running pip as the 'root' user
body: <p>I am making simple image of my python Django app in Docker. But at the end of the building container it throws next warning (I am building it on Ubuntu 20.04):</p>
  <p><code>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</code></p>
  <p>Why does it throw this warning if I am installing Python requirements inside my image? I am building my image using:</p>
  <pre class="lang-sh prettyprint-override"><code>sudo docker build -t my_app:1 .
  </code></pre>
  <p>Should I be worried about warning that pip throws, because I know it can break my system?</p>
  <p>Here is my Dockerfile:</p>
  <pre class="lang-sh prettyprint-override"><code>FROM python:3.8-slim-buster
  
  WORKDIR /app
  COPY requirements.txt requirements.txt
  RUN pip install -r requirements.txt
  COPY . .
  CMD [&quot;python&quot;, &quot;manage.py&quot;, &quot;runserver&quot;, &quot;0.0.0.0:8000&quot;]
  </code></pre>