title: How to install a python package with all the dependencies into a Docker image?
body: <p>I'm working in <strong>Ubuntu 15.10</strong> with the Docker container for Pyspark <strong>jupyter/pyspark-notebook</strong>. I need to install folium with all it's dependencies and run a Pyspark script into the container. I successfully installed Docker, pulled the image  and run it with the command</p>
  
  <pre><code>docker run -d -p 8888:8888 -p 4040:4040 -v /home/$MYUSER/$MYPROJECT:/home/jovyan/work jupyter/pyspark-notebook
  </code></pre>
  
  <p>Then, I execute the code example without any issues</p>
  
  <pre><code>import pyspark
  sc = pyspark.SparkContext('local[*]')
  
  # do something to prove it works
  rdd = sc.parallelize(range(1000))
  rdd.takeSample(False, 5)
  </code></pre>
  
  <p>I looked for the conda environment in <code>/opt/conda</code> (as it says in the <a href="https://github.com/jupyter/docker-stacks/tree/master/pyspark-notebook" rel="noreferrer">documentation</a>) but there is no conda in my <code>/opt</code> folder. Then, I installed miniconda3 and folium with all the dependencies as a normal Python package (no Docker involved).</p>
  
  <p>It doesn't work. When I run the image and try to import the package with <code>import folium</code> it doesn't find the folium package:</p>
  
  <pre><code>ImportErrorTraceback (most recent call last)
  &lt;ipython-input-1-af6e4f19ef00&gt; in &lt;module&gt;()
  ----&gt; 1 import folium
  
  ImportError: No module named 'folium'
  </code></pre>
  
  <p>So the problem can be reduced to two questions:</p>
  
  <ol>
  <li>Where is the container's <em>conda</em>?</li>
  <li>How can I install the Python package I need into the container?</li>
  </ol>