2019-09-25 23:21:11 +02:00
|
|
|
FROM jupyter/base-notebook
|
|
|
|
|
|
|
|
USER root
|
|
|
|
RUN apt-get update -y -q && \
|
|
|
|
apt-get install -y -q \
|
|
|
|
curl \
|
2019-09-27 20:30:44 +02:00
|
|
|
patch \
|
|
|
|
tigervnc-standalone-server \
|
|
|
|
vim
|
2019-09-25 23:21:11 +02:00
|
|
|
|
2019-09-29 22:18:13 +02:00
|
|
|
# Desktop environment, keep in sync with jupyter_notebook_config.py
|
2019-09-29 10:38:14 +02:00
|
|
|
# ENV DESKTOP_PACKAGE lxde
|
|
|
|
ENV DESKTOP_PACKAGE xfce4
|
|
|
|
RUN apt-get install -y -q ${DESKTOP_PACKAGE}
|
2019-09-29 10:36:52 +02:00
|
|
|
|
|
|
|
# Novnc: just want web files, we'll install our own newer websockify
|
2019-09-29 22:18:13 +02:00
|
|
|
RUN cd /opt && \
|
|
|
|
curl -sSfL https://github.com/novnc/noVNC/archive/v1.1.0.tar.gz | tar -zxf -
|
|
|
|
|
|
|
|
# Patch novnc to use correct path to websockify (defaults to /)
|
|
|
|
# Note if you use vnc.html you will need to patch ui.js to use the correct path
|
|
|
|
# and also to override localstorage which may store an incorrect path from a
|
|
|
|
# different session
|
|
|
|
# Also resize server instead of scaling client
|
|
|
|
RUN sed -i.bak \
|
|
|
|
-e "s%\('path', 'websockify'\)%'path', window.location.pathname.replace(/[^/]*$/, '').substring(1) + 'websockify'); console.log('websockify path:' + path%" \
|
|
|
|
-re "s%rfb.scaleViewport = .+%rfb.resizeSession = readQueryVariable('resize', true);%" \
|
|
|
|
/opt/noVNC-1.1.0/vnc_lite.html
|
2019-09-27 20:30:44 +02:00
|
|
|
|
2019-09-26 19:55:21 +02:00
|
|
|
USER jovyan
|
2019-09-29 22:18:13 +02:00
|
|
|
|
|
|
|
# Custom jupyter-server-proxy to load vnc_lite.html instead of /
|
2019-09-26 19:55:21 +02:00
|
|
|
RUN /opt/conda/bin/pip install https://github.com/manics/jupyter-server-proxy/archive/indexpage.zip
|
2019-09-29 22:18:13 +02:00
|
|
|
RUN conda install -y -q -c manics websockify=0.9.0
|
2019-09-27 20:30:44 +02:00
|
|
|
ADD jupyter_notebook_config.py /home/jovyan/.jupyter/jupyter_notebook_config.py
|
2019-09-26 19:55:21 +02:00
|
|
|
|
2019-09-27 20:31:15 +02:00
|
|
|
# There may be a discrepency between the interface vncserver listens on
|
|
|
|
# (127.0.0.1) and the interface jupyter-server-proxy connects to (localhost)
|
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=895582
|
|
|
|
RUN sed -i.bak s/localhost/127.0.0.1/g /opt/conda/lib/python3.7/site-packages/jupyter_server_proxy/handlers.py
|
2019-09-26 19:55:21 +02:00
|
|
|
|
2019-09-29 10:38:14 +02:00
|
|
|
WORKDIR ${HOME}
|
|
|
|
|
2019-09-26 19:55:21 +02:00
|
|
|
# Both these should work:
|
2019-09-29 10:38:14 +02:00
|
|
|
# http://127.0.0.1:8888/desktop
|
2019-09-26 19:58:53 +02:00
|
|
|
# http://localhost:5901/vnc.html
|