Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #19 from kniec/dockerfile-readme
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda authored Jul 7, 2020
2 parents 2ec34f6 + ebbfd67 commit 9c7403c
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM jupyter/base-notebook:python-3.7.6


USER root

RUN apt-get -y update \
&& apt-get install -y dbus-x11 \
firefox \
xfce4 \
xfce4-panel \
xfce4-session \
xfce4-settings \
xorg \
xubuntu-icon-theme

USER $NB_USER
RUN conda install -c manics websockify \
&& pip install jupyter-desktop-server
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,46 @@
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


## Docker

To spin up such a notebook, please build and run the container like this.

```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:

```bash
$ docker run --rm -p 8888:8888 $(whoami)/$(basename ${PWD})
Executing the command: jupyter notebook
[I 12:43:59.148 NotebookApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
[I 12:44:00.221 NotebookApp] JupyterLab extension loaded from /opt/conda/lib/python3.7/site-packages/jupyterlab
[I 12:44:00.221 NotebookApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 12:44:00.224 NotebookApp] Serving notebooks from local directory: /home/jovyan
[I 12:44:00.225 NotebookApp] The Jupyter Notebook is running at:
[I 12:44:00.225 NotebookApp] http://924904e0a646:8888/?token=40475e553b7671b9e93533b97afe584fa2030448505a7d83
[I 12:44:00.225 NotebookApp] or http://127.0.0.1:8888/?token=40475e553b7671b9e93533b97afe584fa2030448505a7d83
[I 12:44:00.225 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 12:44:00.229 NotebookApp]

To access the notebook, open this file in a browser:
file:///home/jovyan/.local/share/jupyter/runtime/nbserver-8-open.html
Or copy and paste one of these URLs:
http://924904e0a646:8888/?token=40475e553b7671b9e93533b97afe584fa2030448505a7d83
or http://127.0.0.1:8888/?token=40475e553b7671b9e93533b97afe584fa2030448505a7d83
*snip*
```

Now head to the URL shown and you will be greated with a XFCE desktop.

0 comments on commit 9c7403c

Please sign in to comment.