Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Dockerfile 3.68 KB
Newer Older
Marco Leoni's avatar
Marco Leoni committed
1 2
FROM jupyter/tensorflow-notebook
# FROM jupyter/scipy-notebook # just commented out
3
#FROM jupyter/minimal-notebook
Marco Leoni's avatar
Marco Leoni committed
4 5

USER root
Nicolas M. Thiéry's avatar
Nicolas M. Thiéry committed
6 7

# Install system utilities with apt
Nicolas Thiéry's avatar
Nicolas Thiéry committed
8
# Also install ocaml and dependency rlwrap for L2 CS course by Kim Nguyen
Marco Leoni's avatar
Marco Leoni committed
9
RUN apt-get update && \
10 11 12 13 14
    apt-get install -y --no-install-recommends \
        openssh-client rsync unison less tree curl gdb imagemagick libopenjp2-7 \
        ocaml rlwrap \
        net-tools traceroute iputils-ping \
        dbus-x11 xfce4 xfce4-panel xfce4-session xfce4-settings xorg xubuntu-icon-theme && \
Marco Leoni's avatar
Marco Leoni committed
15 16 17
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

18 19
# Setup default prompt
RUN echo 'export PS1=`echo $JUPYTERHUB_USER| sed s/-at-.*//`"@jupyterhub:\w\$ "' > /etc/profile.d/02-prompt.sh
20 21
# Hack to override the setting of PS1 in the users's bashrc
RUN ln -s /etc/profile.d/02-prompt.sh /etc/bash_completion
22 23
# Enable extended file globs in bash
RUN echo 'shopt -s extglob' > /etc/profile.d/03-extglob.sh
24 25 26 27
# With the current jupyter emage, conda is activated via
# /etc/skels/.bashrc; older accounts may not beneficiate from it.
# Force activation for everyone.
RUN echo 'eval "$(command conda shell.bash hook 2> /dev/null)"' > /etc/profile.d/04-conda-activate.sh
28 29 30 31 32
# Limit to 10M the size of core dumps
# Limit to 100M the size of files generated from commands in the shell
RUN echo 'ulimit -c 10000; ulimit -f 100000' > /etc/profile.d/05-ulimit.sh
RUN echo 'ulimit -c 10000; ulimit -f 100000' > /etc/profile.d/05-ulimit.sh
# Force core files to be named 'core'
33
RUN echo 'kernel.core_uses_pid = 0' > /etc/sysctl.d/60-local.conf
Marco Leoni's avatar
Marco Leoni committed
34

Nicolas M. Thiéry's avatar
Nicolas M. Thiéry committed
35 36
USER $NB_UID

37 38 39
# Install mamba
RUN conda install mamba -c conda-forge

40
# Install the base software stack
41
# RUN conda update  -n base -c conda-forge --update-all
42
COPY environment.yml .
43
RUN mamba env update -n base -f environment.yml && rm environment.yml
44

45 46 47 48
# https://gitlab.u-psud.fr/Info122/Info122.git           \
# https://github.com/madclam/info113/                    \
# https://github.com/nthiery/M1-ISD-AlgorithmiqueAvancee \
# https://gitlab.u-psud.fr/nicolas.thiery/ter-jupyter    \
49

50
# Install the software stack for each of the following repositories
Marco Leoni's avatar
Marco Leoni committed
51
RUN for REPO in                                                \
52
        https://gitlab.u-psud.fr/MethNum/scripts.git           \
53
        https://gitlab.u-psud.fr/Info111/ComputerLab.git       \
Nicolas M. Thiéry's avatar
Nicolas M. Thiéry committed
54 55 56 57
        https://gitlab.u-psud.fr/Info122/Info122.git           \
        https://github.com/madclam/info113/                    \
        https://github.com/nthiery/M1-ISD-AlgorithmiqueAvancee \
        https://gitlab.u-psud.fr/nicolas.thiery/ter-jupyter    \
Marco Leoni's avatar
Marco Leoni committed
58 59 60 61 62 63
        ; do                                                   \
        echo =================================================;\
        echo Installing software stack for:                   ;\
        echo   $REPO                                          ;\
        echo =================================================;\
        git clone $REPO repo                        &&         \
64
        (cd repo; test -d binder && cd binder; mamba env update -n base -f environment.yml) &&         \
Marco Leoni's avatar
Marco Leoni committed
65 66 67 68
        rm -rf repo                                 ||         \
        break 0;                                               \
    done

69 70
## Install SageMath, for now in a different environment
#RUN mamba create --yes -n sage sage=9.1
71

72 73 74 75
# Enable the Visual Studio proxy extension in notebook and lab
# Taken from https://github.com/betatim/vscode-binder/blob/master/postBuild
RUN jupyter serverextension enable --py jupyter_server_proxy
RUN jupyter labextension install @jupyterlab/server-proxy
76
#RUN code-server --install-extension ms-python.python
77

78
# Install unpackaged jupyterlab extensions and force jupyterlab rebuild
79
RUN jupyter labextension install @wallneradam/run_all_buttons