diff --git a/Dockerfile b/Dockerfile index 87d117f9719a873b66aa9e301ffb94cb4f071ed6..0439eb1c5849d58872b10a28d25c5f70cb9e2762 100644 --- a/Dockerfile +++ b/Dockerfile @@ -159,6 +159,46 @@ RUN echo -e "\e[93m**** Update Jupyter config ****\e[38;5;241m" && \ RUN ln -s /usr/share/plantuml/plantuml.jar /usr/local/bin/ +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + apt-get update && \ + apt-get install -qq --yes --no-install-recommends \ + dbus-x11 \ + libgl1-mesa-glx \ + xfce4 \ + xfce4-panel \ + xfce4-session \ + 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 && \ + conda install -c conda-forge websockify + USER $NB_USER # preinstall gitstatusd diff --git a/README.md b/README.md index 2ef7b7322c46ba0093363fc9d8e6ead60da0c890..34e95e13828a9d79689b883ef314882eb8817362 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 diff --git a/build.sh b/build.sh index f34af6d76c8e0947677232c985cd4eeacf4f05e5..213138720ac57e78b6735c1b6fe8d2a568b62cd3 100755 --- a/build.sh +++ b/build.sh @@ -1,2 +1,2 @@ #!/bin/bash -docker build --progress=plain -t brunoe/${PWD##*/}:$(git rev-parse --abbrev-ref HEAD) . +docker build --progress=plain -t brunoe/${PWD##*/}:$(git rev-parse --abbrev-ref HEAD|tr '/' '-') . diff --git a/run.sh b/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..9bd297a2d7ab1f377c1107c181ea274786711115 --- /dev/null +++ b/run.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +WORKDIR=$HOME/JUPYTER_WORK_DIR + +echo brunoe/${PWD##*/}:$(git rev-parse --abbrev-ref HEAD) + +docker run --rm -it \ + --user root \ + --name ${PWD##*/} \ + --volume $WORKDIR:/home/jovyan/work \ + --publish 8888:8888 \ + --env NB_UID=$UID \ + brunoe/${PWD##*/}:$(git rev-parse --abbrev-ref HEAD|tr '/' '-') $@ +# --env CHOWN_HOME_OPTS='-R' --env CHOWN_HOME=yes \ + \ No newline at end of file