Skip to content
Snippets Groups Projects
Commit 0d7ae091 authored by Emmanuel Bruno's avatar Emmanuel Bruno
Browse files

cleans up.

parent 91e2f434
No related branches found
No related tags found
No related merge requests found
#FROM jupyter/scipy-notebook:584f43f06586
#FROM jupyter/scipy-notebook:2021-09-07
FROM jupyter/scipy-notebook:2021-10-20
USER root
RUN apt-get update && apt-get install -y \
RUN apt-get update --yes && apt-get install --yes --no-install-recommends \
bash \
curl \
less \
openssh-client \
# texlive \
# texlive-lang-french \
# texlive-latex-extra \
vim \
unzip \
zip && \
apt-get clean && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/apt && \
echo en_US.UTF-8 UTF-8 >> /etc/locale.gen && \
locale-gen
# Sets locale as default
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8
apt-get clean && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/apt
# Sets codeserver directories
ENV CODESERVEREXT_DIR /opt/codeserver/extensions
......@@ -29,14 +15,10 @@ ENV CODE_WORKINGDIR $HOME/work
ENV CODESERVERDATA_DIR $HOME/work/codeserver/data
ENV PATH=/opt/bin:$PATH
# Add conda env hook
# COPY ./conda-activate.sh /usr/local/bin/before-notebook.d/
# RUN jupyter labextension install @jupyterlab/latex doesn't work with lab 3.0
# SO we test a fork. TODO: Multistage Build
# Enable persistant conda env
COPY condarc /home/jovyan/.condarc
# Instalk JupyterLab
RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \
pip install --quiet --no-cache-dir --upgrade \
jupyter-book \
......@@ -52,12 +34,11 @@ RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \
# jupyter labextension install jupyterlab_templates && \
# jupyter serverextension enable --py jupyterlab_templates && \
# conda install defaults::nb_conda_kernels && \
conda install nb_conda_kernels && \
conda install -c conda-forge jupyterlab-drawio && \
conda install -c conda-forge jupyterlab_code_formatter && \
# conda install black isort && \
# pip install jupyterlab-lsp 'python-lsp-server[all]' && \
conda install -c conda-forge tectonic texlab chktex && \
mamba install --quiet --yes nb_conda_kernels && \
mamba install --quiet --yes -c conda-forge \
jupyterlab-drawio \
jupyterlab_code_formatter \
tectonic texlab chktex && \
echo -e "\e[93m**** Installs Code Server Web ****\e[38;5;241m" && \
curl -fsSL https://code-server.dev/install.sh | sh -s -- --prefix=/opt --method=standalone && \
mkdir -p $CODESERVEREXT_DIR && \
......@@ -77,9 +58,11 @@ RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \
adduser "$NB_USER" codeserver && \
echo -e "\e[93m**** Clean up ****\e[38;5;241m" && \
npm cache clean --force && \
mamba clean --all -f -y && \
jupyter lab clean && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER
rm -rf "/home/${NB_USER}/.cache/yarn" && \
fix-permissions "$CONDA_DIR" && \
fix-permissions "/home/$NB_USER"
COPY configs/* /home/jovyan/.jupyter/
COPY code-server/jupyter_codeserver_config.py /tmp/
......@@ -87,16 +70,33 @@ COPY code-server/icons $HOME/.jupyter/icons
RUN [[ ! -f /home/jovyan/.jupyter/jupyter_config.py ]] && touch /home/jovyan/.jupyter/jupyter_config.py ; \
cat /tmp/jupyter_codeserver_config.py >> /home/jovyan/.jupyter/jupyter_config.py
RUN echo 'for dir in /home/jovyan/work/.ssh; do \n' \
'if [ ! -f $dir ]; then \n' \
'echo "Creating $dir"\n' \
'mkdir -p $dir\n' \
'chmod 700 $dir\n' \
'fi\n' \
'done'>> /etc/skel/.bashrc && \
touch /home/jovyan/work/.gitconfig
COPY nbgrader_config.py /tmp/nbgrader_config.py
RUN python3 -m pip install git+https://github.com/jupyter/nbgrader.git@5a81fd5 && \
jupyter nbextension install --symlink --sys-prefix --py nbgrader && \
jupyter nbextension enable --sys-prefix --py nbgrader && \
jupyter serverextension enable --sys-prefix --py nbgrader && \
python3 -m pip install ngshare_exchange && \
cat /tmp/nbgrader_config.py >> /etc/jupyter/nbgrader_config.py
cat /tmp/nbgrader_config.py >> /etc/jupyter/nbgrader_config.py && \
echo -e "\e[93m**** Clean up ****\e[38;5;241m" && \
npm cache clean --force && \
mamba clean --all -f -y && \
jupyter lab clean && \
rm -rf "/home/${NB_USER}/.cache/yarn" && \
fix-permissions "$CONDA_DIR" && \
fix-permissions "/home/$NB_USER"
USER $NB_USER
RUN echo -e "\e[93m***** Moves user environment to work subdirectory ****\e[38;5;241m" && \
ln -s work/.gitconfig .gitconfig && \
mkdir work/.ssh && ln -s work/.ssh .ssh
WORKDIR "${HOME}/work"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment