Created
May 11, 2018 20:05
-
-
Save hohonuuli/ba6a233389944386c7eae397f45eba4f to your computer and use it in GitHub Desktop.
Dockerfile for a scipy setup using jupyter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends \ | |
build-essential \ | |
curl \ | |
cmake \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN curl -qsSLkO \ | |
https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-`uname -p`.sh \ | |
&& bash Miniconda3-latest-Linux-`uname -p`.sh -b \ | |
&& rm Miniconda3-latest-Linux-`uname -p`.sh | |
ENV PATH=/root/miniconda3/bin:$PATH | |
RUN conda install -y \ | |
h5py \ | |
pandas \ | |
jupyter \ | |
matplotlib \ | |
seaborn \ | |
scikit-learn \ | |
pandas | |
RUN conda config --append channels conda-forge | |
RUN conda install -y tensorflow keras | |
RUN conda clean --yes --tarballs --packages --source-cache | |
RUN apt-get update && apt-get install -y graphviz xvfb python-opengl | |
RUN pip install --upgrade pip && \ | |
pip install graphviz xgboost | |
VOLUME /notebook | |
WORKDIR /notebook | |
EXPOSE 8888 | |
CMD xvfb-run -s "-screen 0 1400x900x24" jupyter notebook --allow-root --no-browser --ip=0.0.0.0 --NotebookApp.token= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I thought I'd leave a comment in case another Docker newbie finds this gem, as it's not immediately clear how to use it.
Here's what I did on my Mac:
mkdir ~/docker_notebook
cd ~/docker_notebook
Dockerfile
docker build . -t notebook
docker run -p 8888:8888 -v ~/docker_notebook:/notebook notebook
Then open a browser on the Mac pointing to http://localhost:8888. Any notebooks I save in the web interface will be in the
~/docker_notebook
directory.The output from the
docker run ...
command statesUse Control-C to stop this server and shut down all kernels (twice to skip confirmation).
but that doesn't work. I needed to issue adocker stop <container_id>
after getting the <container_id> from adocker ps
.