Skip to content
Snippets Groups Projects
Commit b3aad564 authored by Simon Li's avatar Simon Li
Browse files

Use vncserver from PATH if found

parent 9a925345
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,8 @@ RUN apt-get -y update \
RUN wget 'https://sourceforge.net/projects/turbovnc/files/2.2.5/turbovnc_2.2.5_amd64.deb/download' -O turbovnc_2.2.5_amd64.deb && \
apt-get install ./turbovnc_2.2.5_amd64.deb && \
rm ./turbovnc_2.2.5_amd64.deb
rm ./turbovnc_2.2.5_amd64.deb && \
ln -s /opt/TurboVNC/bin/* /usr/local/bin/
# apt-get may result in root-owned directories/files under $HOME
RUN chown -R $NB_UID:$NB_GID $HOME
......
......@@ -5,22 +5,16 @@ Run XFCE (or other desktop environments) on a JupyterHub.
This is based on https://github.com/ryanlovett/nbnovnc and a fork of https://github.com/manics/jupyter-omeroanalysis-desktop
If a `vncserver` executable is found in `PATH` it will be used, otherwise a bundled TightVNC server is run.
You can use this to install vncserver with support for other features, for example the [`Dockerfile`](./Dockerfile) in this repository installs TurboVNC for improved OpenGL support.
## Docker
To spin up such a notebook, please build and run the container like this.
## Docker
To spin up such a notebook first build the container:
```bash
$ docker build -t $(whoami)/$(basename ${PWD}) .
Sending build context to Docker daemon 36.76MB
Step 1/5 : FROM jupyter/datascience-notebook:latest
**snip**
Successfully installed aiohttp-3.6.2 async-timeout-3.0.1 jupyter-desktop-server-0.1.2 jupyter-server-proxy-1.5.0 multidict-4.7.6 simpervisor-0.3 yarl-1.4.2
Removing intermediate container ed906d6b1074
---> 826211e74ce1
Successfully built 826211e74ce1
Successfully tagged myname/jupyter-desktop-server:latest
$
```
Now you can ran the image:
......
import os
import shlex
from shutil import which
import tempfile
......@@ -10,11 +11,11 @@ def setup_desktop():
# This is only readable, writeable & searchable by our uid
sockets_dir = tempfile.mkdtemp()
sockets_path = os.path.join(sockets_dir, 'vnc-socket')
turbovnc = '/opt/TurboVNC/bin/vncserver'
vncserver = which('vncserver')
if os.path.exists(turbovnc):
if vncserver:
vnc_args = [
'/opt/TurboVNC/bin/vncserver',
vncserver,
]
socket_args = []
else:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment