title: Run pip in python docker
body: <p>I am completely new to docker (on windows 10 machine). I intend to setup a python development environment as a docker container. And most of the reading that I did involved the use of Dockerfile. I want to do it from scratch instead purely using commands.</p>
  <p>What I intend to do is very basic requirement: To have python docker image present with me and that I should be able to install more libraries in that image and commit these updates to that image. But I want to do it completely using commands (not via a Dockerfile).</p>
  <p>I am using Docker Desktop on windows 10 machine. I did <code>docker pull python:latest</code> and it pulled the image like so:</p>
  <pre><code>C:\Users\MyHomeDirectory&gt;docker pull python:latest
  latest: Pulling from library/python
  d960726af2be: Pull complete
  e8d62473a22d: Pull complete
  8962bc0fad55: Pull complete
  65d943ee54c1: Pull complete
  532f6f723709: Pull complete
  1334e0fe2851: Pull complete
  062ada600c9e: Pull complete
  aec2e3a89371: Pull complete
  1ec7c3bcb4b2: Pull complete
  Digest: sha256:65367d1d3eb47f62127f007ea1f74d1ce11be988044042ab45d74adc6cfceb21
  Status: Downloaded newer image for python:latest
  docker.io/library/python:latest
  </code></pre>
  <p>Then I did <code>docker images</code> and it showed that python latest image is present with a size of <code>886 MB</code>.</p>
  <pre><code>C:\Users\Tejas.Khajanchee&gt;docker images
  REPOSITORY    TAG       IMAGE ID       CREATED        SIZE
  python        latest    5b3b4504ff1f   47 hours ago   886MB
  </code></pre>
  <p>I am also able to enter the interactive python by doing <code>docker run -it python</code> and it generates the interactive shell:</p>
  <pre><code>Python 3.9.5 (default, May 12 2021, 15:26:36)
  [GCC 8.3.0] on linux
  Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
  &gt;&gt;&gt;
  &gt;&gt;&gt; import gc
  &gt;&gt;&gt; import numpy
  Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  ModuleNotFoundError: No module named 'numpy'
  &gt;&gt;&gt;
  &gt;&gt;&gt; import pandas
  Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  ModuleNotFoundError: No module named 'pandas'
  &gt;&gt;&gt;
  &gt;&gt;&gt; import openpyxl
  Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  ModuleNotFoundError: No module named 'openpyxl'
  &gt;&gt;&gt;
  </code></pre>
  <p>But as evident, some of the libraries are not installed. But this is where I get stuck. How do I install libraries into the python image and have the image updated. Also, if this shell is the only thing that I am allowed to do till now, what does the <code>886 MB</code> content represent? Also I want to be able to run scripts using this docker image. When I attempt to do this on a very basic hello world script, the following error comes up:</p>
  <pre><code>C:\Users\MyHomeDirectory\Downloads&gt;docker run -it python a.py
  docker: Error response from daemon: OCI runtime create failed: container_linux.go:367: starting container process caused: exec: &quot;a.py&quot;: executable file not found in $PATH: unknown.
  </code></pre>
  <p>I want to be able to do this purely with commands and not a Dockerfile. Please help.</p>