mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2024-11-27 04:16:45 +01:00
Merge branch 'master' of github.com:jfrazelle/dockerfiles
* 'master' of github.com:jfrazelle/dockerfiles: dunnet doctor tetris simplescreenrecorder
This commit is contained in:
commit
1386ce39ee
33
ipython-notebook/Dockerfile
Normal file
33
ipython-notebook/Dockerfile
Normal file
|
@ -0,0 +1,33 @@
|
|||
FROM python:2.7.8
|
||||
MAINTAINER Jessica Frazelle <jess@docker.com>
|
||||
|
||||
RUN pip install -U numpy
|
||||
|
||||
# install linear algebra dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gfortran \
|
||||
libopenblas-dev \
|
||||
liblapack-dev \
|
||||
libzmq-dev \
|
||||
--no-install-recommends
|
||||
RUN pip install -U scipy
|
||||
|
||||
RUN pip install -U matplotlib
|
||||
RUN pip install -U pandas
|
||||
RUN pip install -U patsy
|
||||
RUN pip install -U statsmodels
|
||||
RUN pip install -U scikit-learn
|
||||
RUN pip install -U ggplot
|
||||
RUN pip install -U pyzmq
|
||||
RUN pip install -U jinja2
|
||||
RUN pip install -U tornado
|
||||
RUN pip install -U ipython
|
||||
|
||||
EXPOSE 8888
|
||||
|
||||
ADD notebook.sh /
|
||||
RUN chmod u+x /notebook.sh && mkdir -p /root/notebooks
|
||||
|
||||
WORKDIR /root/notebooks
|
||||
|
||||
CMD ["/notebook.sh"]
|
21
ipython-notebook/notebook.sh
Normal file
21
ipython-notebook/notebook.sh
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Strict mode
|
||||
IFS=$'\n\t'
|
||||
|
||||
if [[ -z "$PEM_FILE" ]]; then
|
||||
PEM_FILE=/key.pem
|
||||
fi
|
||||
|
||||
# Create a self signed certificate for the user if one doesn't exist
|
||||
if [[ ! -f $PEM_FILE ]]; then
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout $PEM_FILE -out $PEM_FILE \
|
||||
-subj "/C=XX/ST=XX/L=XX/O=dockergenerated/CN=dockergenerated"
|
||||
fi
|
||||
|
||||
# Create the hash to pass to the IPython notebook, but don't export it so it doesn't appear
|
||||
# as an environment variable within IPython kernels themselves
|
||||
HASH=$(python -c "from IPython.lib import passwd; print passwd('${PASSWORD}')")
|
||||
unset PASSWORD
|
||||
|
||||
ipython notebook --pylab=inline --ip=* --no-browser --port 8888 --certfile=$PEM_FILE --NotebookApp.password="$HASH"
|
Loading…
Reference in New Issue
Block a user