======
Docker
======

Read the `official Docker documentation <http://docs.docker.com>`_ and specifically 
the information related to `Docker images <https://docs.docker.com/engine/userguide/eng-image/>`_.

Begin by browsing the available Anaconda images `on our Docker profile <https://hub.docker.com/r/continuumio/>`_.

To obtain a fully working Anaconda image:

#. In a terminal window, run this command to display a list of available images::

    docker search continuumio

#. Pull the desired image::

    docker pull continuumio/miniconda

#. Create a container using the image::

    docker run -t -i continuumio/miniconda /bin/bash

   This gives you direct access to the container where the conda tool is already available. 

#. Test the container::

    conda info

   You now have a fully working Anaconda image.


To install and launch the Jupyter Notebook, execute the following command all on one line from
the host machine::

    docker run -i -t -p 8888:8888 continuumio/miniconda /bin/bash
    -c "/opt/conda/bin/conda install jupyter -y --quiet && mkdir
    /opt/notebooks && /opt/conda/bin/jupyter notebook
    --notebook-dir=/opt/notebooks --ip='*' --port=8888
    --no-browser"

NOTE: Line breaks in the example above are for readability only. Enter the command all on one line.

To access the Jupyter notebook open http://localhost:8888 in your browser,
or open http://<DOCKER-MACHINE-IP>:8888 if you are using a Docker Machine VM.

NOTE: Replace ``<DOCKER-MACHINE-IP>`` with your Docker Machine VM IP address.
