diff --git a/Dockerfile b/Dockerfile index cd420466..90f59a1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 . . diff --git a/README.rst b/README.rst index 96e822f2..2d81b815 100644 --- a/README.rst +++ b/README.rst @@ -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 --------