title: Why use requirements.txt in a Docker image
body: <p>There is a <a href="https://stackoverflow.com/questions/55311248/">similar question</a> from last year but I don't think the responses are widely applicable and it's not accepted.</p>
  <p>Edit: this is in the context of developing small jobs that will only be run in docker in-house; I'm not talking about sharing work with anyone outside a small team, or about projects getting heavy re-use.</p>
  <p>What advantage do you see in using requirements.txt to install instead of  pip install commands in Dockerfile?  I see one: your Dockerfile for various projects is more cookie-cutter.</p>
  <p>I'm not even thinking of the use of setup envisioned in the question I linked.</p>
  <p>What downside is there to naming the packages in Dockerfile:</p>
  <pre><code> RUN   pip install --target=/build  django==3.0.1 Jinja2==2.11.1 .  . . 
  </code></pre>
  <p>EDIT 2: @superstormer asked &quot;what are the upsides to putting it in Dockefile&quot; -- fair question.  I read co-workers' dockerfiles in Gitlab and have to navigate to the requirements, I don't have it locally in an editor. EDIT3: Note to self: so clone it and look at it in an editor.</p>