Skip to content

Commit

Permalink
Add jupyter notebook to the docker image.
Browse files Browse the repository at this point in the history
  • Loading branch information
rainwoodman committed May 20, 2017
1 parent 634633a commit 3623a3f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Expand Up @@ -14,6 +14,20 @@ RUN apt-get -qqy update && \
git \
curl

# install python and jupyter
RUN apt-get update && apt-get install -qqy \
python \
python-dev

RUN curl -fSsL -O https://bootstrap.pypa.io/get-pip.py && \
python get-pip.py && \
rm get-pip.py

RUN pip --no-cache-dir install \
setuptools \
numpy \
jupyter

# Load fastpm into docker
WORKDIR /fastpm
COPY . .
Expand Down
27 changes: 20 additions & 7 deletions README.rst
Expand Up @@ -180,23 +180,36 @@ is recommended.
Docker
------

There is a basic docker configuration file to set up a container
for FastPM.
There is a basic docker configuration file to set up a container for FastPM.

To build it, run:

.. code::
docker build -t fastpm .
# first remove all prebuilt binary files
To start the docker container in interactive mode,
with port 8888 exposed and with
``/my/file/directory`` linked, run
make deep-clean
sudo docker build -t fastpm .
To start the docker container in interactive mode,
with port 8888 exposed and linking ``/my/file/directory`` to ``/worksapce``, run

.. code::
docker run -it -v /my/file/directory:/workspace -p 8888:8888 fastpm
sudo docker run -it -v /my/file/directory:/workspace -p 8888:8888 fastpm
We install a jupyter notebook service in the docker image, which listens on the
forwarded port of 8888.

.. code::
jupyter notebook --ip=* --allow-root
As of now, proper set up of docker needs root access.
It may be necesssary to prepend `su -c` or `sudo` in docker command line, see [docker-root]_.

.. [docker-root] http://www.projectatomic.io/blog/2015/08/why-we-dont-let-non-root-users-run-docker-in-centos-fedora-or-rhel/
Examples
--------
Expand Down

0 comments on commit 3623a3f

Please sign in to comment.