This repository has been archived by the owner on Jul 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
61 lines (45 loc) · 1.98 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# This file creates a container that runs a jupyter notebook server on Raspberry Pi
#
# Author: Dmitrii Gerasimenko
# Date 28/07/2018
#
# Originally from: https://github.com/mkjiang/rpi-jupyter/blob/master/Dockerfile
#
FROM resin/raspberrypi3-python:3.6
MAINTAINER Dmitry Gerasimenko <kiddima@gmail.com>
WORKDIR /root
# Update pip and install jupyter
RUN apt-get update && apt-get install -y libncurses5-dev libzmq-dev libfreetype6-dev libpng-dev
RUN pip3 install --upgrade pip
RUN pip3 install readline ipywidgets jupyter jupyterlab
# Configure jupyter
RUN jupyter nbextension enable --py widgetsnbextension
RUN jupyter serverextension enable --py jupyterlab
RUN jupyter notebook --generate-config
RUN mkdir notebooks
RUN sed -i "/c.NotebookApp.open_browser/c c.NotebookApp.open_browser = False" /root/.jupyter/jupyter_notebook_config.py \
&& sed -i "/c.NotebookApp.ip/c c.NotebookApp.ip = '*'" /root/.jupyter/jupyter_notebook_config.py \
&& sed -i "/c.NotebookApp.notebook_dir/c c.NotebookApp.notebook_dir = '/root/notebooks'" /root/.jupyter/jupyter_notebook_config.py
VOLUME /root/notebooks
# Add Tini. Tini operates as a process subreaper for jupyter. This prevents kernel crashes.
ENV TINI_VERSION 0.18.0
ENV CFLAGS="-DPR_SET_CHILD_SUBREAPER=36 -DPR_GET_CHILD_SUBREAPER=37"
ADD https://github.com/krallin/tini/archive/v${TINI_VERSION}.tar.gz /root/v${TINI_VERSION}.tar.gz
RUN apt-get install -y cmake
RUN tar zxvf v${TINI_VERSION}.tar.gz \
&& cd tini-${TINI_VERSION} \
&& cmake . \
&& make \
&& cp tini /usr/bin/. \
&& cd .. \
&& rm -rf "./tini-${TINI_VERSION}" \
&& rm "./v${TINI_VERSION}.tar.gz"
# Install usefull python packages for data scientists
#RUN apt-get install -y \
# libhdf5-dev \
# liblapack-dev \
# gfortran
#RUN pip3 install requests numpy scipy scikit-learn nltk pandas seaborn tables matplotlib ipywidgets
ENTRYPOINT ["/usr/bin/tini", "--"]
EXPOSE 8888
CMD ["jupyter", "lab", "--allow-root"]