From 853d68304afafcca0e100bdea1052f782557c332 Mon Sep 17 00:00:00 2001
From: Emmanuel Bruno <emmanuel.bruno@univ-tln.fr>
Date: Mon, 17 Apr 2023 10:25:33 +0200
Subject: [PATCH] adds remote desktop

---
 Dockerfile | 23 ++++++++++++++++++++++-
 README.md  |  1 +
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index a4556b3..0439eb1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -170,13 +170,34 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
         xfce4-settings \
         xorg \
         xubuntu-icon-theme && \
+    chown -R $NB_UID:$NB_GID $HOME && \
 	rm -rf /var/lib/apt/lists/*
 
+# Install TurboVNC (https://github.com/TurboVNC/turbovnc)
+ARG TURBOVNC_VERSION=3.0.3
+RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
+		ARCH_LEG=x86_64; \
+		ARCH=amd64; \
+	elif [ "$TARGETPLATFORM" = "linux/arm64/v8" ] || [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
+		ARCH_LEG=aarch64; \
+		ARCH=arm64; \
+	else \
+		ARCH_LEG=amd64; \
+		ARCH=amd64; \
+	fi && \
+ wget -q "https://sourceforge.net/projects/turbovnc/files/${TURBOVNC_VERSION}/turbovnc_${TURBOVNC_VERSION}_${ARCH}.deb/download" -O turbovnc.deb \
+ && apt-get install -y -q ./turbovnc.deb \
+    # remove light-locker to prevent screen lock
+ && apt-get remove -y -q light-locker \
+ && rm ./turbovnc.deb \
+ && ln -s /opt/TurboVNC/bin/* /usr/local/bin/
+
 RUN --mount=type=cache,target=${PIP_CACHE_DIR},sharing=locked  \
     --mount=type=cache,target=${CONDA_PKG_DIR},sharing=locked  \
         echo -e "\e[93m***** Install Jupyter Remote desktop Extension ****\e[38;5;241m" && \
         pip install --quiet --upgrade \
-			jupyter-remote-desktop-proxy
+			jupyter-remote-desktop-proxy && \
+        conda install -c conda-forge websockify
 
 USER $NB_USER
 
diff --git a/README.md b/README.md
index 2ef7b73..34e95e1 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,7 @@ A base image for the Jupyter Lab ased on jupyter/minimal-notebook :
 * TexLive
 * Code Server Web IDE
 * Jupyter Book
+* Web remote desktop
 
 ## Quickstart
 
-- 
GitLab