jupyter-desktop-server/Dockerfile

47 lines
1.8 KiB
Docker
Raw Normal View History

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 \
patch \
tigervnc-standalone-server \
vim
2019-09-25 23:21:11 +02:00
# Desktop environment, keep in sync with jupyter_notebook_config.py
# 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
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
USER jovyan
# Custom jupyter-server-proxy to load vnc_lite.html instead of /
RUN /opt/conda/bin/pip install https://github.com/manics/jupyter-server-proxy/archive/indexpage.zip
RUN conda install -y -q -c manics websockify=0.9.0
ADD jupyter_notebook_config.py /home/jovyan/.jupyter/jupyter_notebook_config.py
# 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
WORKDIR ${HOME}
# Both these should work:
# http://127.0.0.1:8888/desktop
2019-09-26 19:58:53 +02:00
# http://localhost:5901/vnc.html