-
Notifications
You must be signed in to change notification settings - Fork 447
/
Dockerfile.jupyter
48 lines (34 loc) · 1.61 KB
/
Dockerfile.jupyter
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
FROM jupyter/base-notebook
ARG dev_mode=false
USER root
# This is needed because requests-kerberos fails to install on debian due to missing linux headers
RUN conda install requests-kerberos -y
USER $NB_USER
RUN pip install --upgrade pip
RUN pip install --upgrade --ignore-installed setuptools
COPY examples /home/jovyan/work
# Install sparkmagic - if DEV_MODE is set, use the one in the host directory.
# Otherwise, just install from pip.
COPY hdijupyterutils hdijupyterutils/
COPY autovizwidget autovizwidget/
COPY sparkmagic sparkmagic/
USER root
RUN chown -R $NB_USER .
USER $NB_USER
RUN if [ "$dev_mode" = "true" ]; then \
cd hdijupyterutils && pip install -e . && cd ../ && \
cd autovizwidget && pip install -e . && cd ../ && \
cd sparkmagic && pip install -e . && cd ../ ; \
else pip install sparkmagic ; fi
RUN mkdir /home/$NB_USER/.sparkmagic
COPY sparkmagic/example_config.json /home/$NB_USER/.sparkmagic/config.json
RUN sed -i 's/localhost/spark/g' /home/$NB_USER/.sparkmagic/config.json
RUN pip install ipywidgets
RUN jupyter-kernelspec install --user $(pip show sparkmagic | grep Location | cut -d" " -f2)/sparkmagic/kernels/sparkkernel
RUN jupyter-kernelspec install --user $(pip show sparkmagic | grep Location | cut -d" " -f2)/sparkmagic/kernels/pysparkkernel
RUN jupyter-kernelspec install --user $(pip show sparkmagic | grep Location | cut -d" " -f2)/sparkmagic/kernels/sparkrkernel
RUN jupyter server extension enable --py sparkmagic
USER root
RUN chown $NB_USER /home/$NB_USER/.sparkmagic/config.json
CMD ["start-notebook.sh", "--NotebookApp.iopub_data_rate_limit=1000000000"]
USER $NB_USER