Skip to content

Commit 972bc9a

Browse files
committed
Installed python2 in jupyter/base-notebook
It is now available in the notebook, but still has to be selected. Should be made default, or python3 should be removed. Removing should be done by the rm -rfv line in the Dockerfile, but appearantly it does not work. Hints, I've read: - https://stackoverflow.com/questions/30492623/using-both-python-2-x-and-python-3-x-in-ipython-notebook - https://stackoverflow.com/questions/42635310/remove-kernel-on-jupyter-notebook
1 parent f985855 commit 972bc9a

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

Dockerfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
# build with `docker build -t dockername:tag .`
22
# run with `docker run -p 8888:8888 dockername:tag`
33
# open http://localhost:8888 in browser
4-
FROM debian
4+
FROM jupyter/base-notebook
55

6-
RUN apt-get update && apt-get install -y python python-pip
7-
RUN pip install jupyter
6+
USER root
7+
RUN /bin/bash -c "conda create --yes -n py27 python=2.7; source activate py27; conda install --yes notebook ipykernel; ipython kernel install"
8+
RUN rm -rfv /opt/conda/share/jupyter/kernels/python3/
89

9-
RUN mkdir /var/www
10-
COPY . /var/www
11-
WORKDIR /var/www
10+
COPY . /home/jovyan
11+
RUN chown -R jovyan:users /home/jovyan
1212

1313
# config to run without authentication
14-
RUN mkdir /root/.jupyter
15-
RUN echo "c.NotebookApp.token = u''" >> /root/.jupyter/jupyter_notebook_config.py
16-
17-
CMD ["jupyter-notebook", "--no-browser", "--ip=0.0.0.0", "--allow-root"] # to prevent listening on IPv6
14+
USER jovyan
15+
RUN mkdir /home/jovyan/.jupyter >> /dev/null || echo ""
16+
RUN echo "c.NotebookApp.token = u''" >> /home/jovyan/.jupyter/jupyter_notebook_config.py
1817

0 commit comments

Comments
 (0)