1- # Jupyter container used for Galaxy IPython (+other kernels) Integration
1+ FROM quay.io/jupyter/base-notebook:latest
22
3- # We want to support Python, R, Julia, Bash and to a lesser degree ansible, octave
4- # https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html
5- # Accoring to the link above we should take scipy-notebook and add additional kernels.
6- # Since Julia installation seems to be complicated we will take the Julia notebook as base and install separate kernels into separate envs
7- FROM quay.io/jupyter/julia-notebook:python-3.12
8-
9- LABEL org.opencontainers.image.authors="Björn A. Grüning, bjoern.gruening@gmail.com"
3+ LABEL org.opencontainers.image.source=https://github.com/IMTEK-Simulation/Docker4Teching
104
115ENV DEBIAN_FRONTEND=noninteractive
126
13- # Set channels to bioconda > conda-forge
7+ EXPOSE 8888
8+
9+ USER root
10+
11+ RUN apt-get update && apt-get install -y --no-install-recommends \
12+ build-essential gcc g++ gfortran liblapack-dev libblas-dev \
13+ git wget curl ca-certificates libglu1-mesa-dev libgmp-dev unixodbc-dev \
14+ && rm -rf /var/lib/apt/lists/*
15+
16+ USER $NB_UID
17+
18+ SHELL ["/bin/bash" , "-lc" ]
19+
1420RUN conda config --add channels bioconda && \
1521 conda config --add channels conda-forge && \
1622 conda config --set channel_priority strict && \
23+ conda install -y mamba -n base -c conda-forge && \
1724 conda --version
1825
19- # Install python and jupyter packages
20- RUN conda install --yes \
26+ RUN mamba install -y \
2127 bioblend galaxy-ie-helpers \
2228 biopython \
2329 cloudpickle \
@@ -35,100 +41,23 @@ RUN conda install --yes \
3541 pyvista \
3642 python-gmsh \
3743 statsmodels && \
38- conda create -n bash-kernel --yes bash_kernel=0.10.0 bioblend galaxy-ie-helpers && \
44+ mamba clean --all -y
45+
46+ RUN mamba create -y -n bash-kernel bash_kernel=0.10.0 bioblend galaxy-ie-helpers && \
3947 conda run -n bash-kernel python -m bash_kernel.install --user && \
40- conda create -n ansible-kernel --yes ansible-kernel=1.0.0 jupyter_client bioblend galaxy-ie-helpers && \
48+ mamba create -y - n ansible-kernel ansible-kernel=1.0.0 jupyter_client bioblend galaxy-ie-helpers && \
4149 conda run -n ansible-kernel python -m ansible_kernel.install && \
42- conda create -n octave-kernel --yes python=3.8 octave_kernel=0.36.0 bioblend galaxy-ie-helpers && \
50+ mamba create -y - n octave-kernel python=3.8 octave_kernel=0.36.0 bioblend galaxy-ie-helpers && \
4351 conda run -n octave-kernel python -m octave_kernel install --user && \
44- conda create -n rlang-kernel --yes r-base r-irkernel=1.3.2 r-xml rpy2 bioblend galaxy-ie-helpers \
45- 'r-caret' \
46- 'r-crayon' \
47- 'r-devtools' \
48- 'r-e1071' \
49- 'r-forecast' \
50- 'r-hexbin' \
51- 'r-htmltools' \
52- 'r-htmlwidgets' \
53- 'r-irkernel' \
54- 'r-nycflights13' \
55- 'r-randomforest' \
56- 'r-rcurl' \
57- 'r-rmarkdown' \
58- 'r-rodbc' \
59- 'r-rsqlite' \
60- 'r-shiny' \
61- 'r-tidymodels' \
62- 'r-tidyverse' \
63- 'unixodbc' && \
52+ mamba create -y -n rlang-kernel r-base r-irkernel=1.3.2 r-xml rpy2 bioblend galaxy-ie-helpers \
53+ r-caret r-crayon r-devtools r-e1071 r-forecast r-hexbin r-htmltools r-htmlwidgets \
54+ r-irkernel r-nycflights13 r-randomforest r-rcurl r-rmarkdown r-rodbc r-rsqlite r-shiny \
55+ r-tidymodels r-tidyverse unixodbc && \
6456 conda run -n rlang-kernel R -e "IRkernel::installspec(user = TRUE, name = 'rlang-kernel', displayname = 'R')" && \
65- conda clean --all -y && \
66- chmod a+w+r /opt/conda/ -R
67-
68- RUN echo 'Sys.setenv(CONDA_PREFIX = "/opt/conda/envs/rlang-kernel")' >> /home/$NB_USER/.Rprofile && \
69- echo 'Sys.setenv(PATH = paste("/opt/conda/envs/rlang-kernel/bin", Sys.getenv("PATH"), sep=":"))' >> /home/$NB_USER/.Rprofile && \
70- echo 'Sys.setenv(PROJ_LIB = "/opt/conda/envs/rlang-kernel/share/proj")' >> /home/$NB_USER/.Rprofile && \
71- chown $NB_USER /home/$NB_USER/.Rprofile
72-
73- ADD ./startup.sh /startup.sh
74- # ADD ./monitor_traffic.sh /monitor_traffic.sh
75- ADD ./get_notebook.py /get_notebook.py
76-
77- # We can get away with just creating this single file and Jupyter will create the rest of the
78- # profile for us.
79- RUN mkdir -p /home/$NB_USER/.ipython/profile_default/startup/ && \
80- mkdir -p /home/$NB_USER/.jupyter/custom/
81-
82- ADD ./ipython-profile.py /home/$NB_USER/.ipython/profile_default/startup/00-load.py
83- ADD jupyter_notebook_config.py /home/$NB_USER/.jupyter/
84- ADD jupyter_lab_config.py /home/$NB_USER/.jupyter/
85-
86- ADD ./custom.js /home/$NB_USER/.jupyter/custom/custom.js
87- ADD ./custom.css /home/$NB_USER/.jupyter/custom/custom.css
88- ADD ./default_notebook.ipynb /home/$NB_USER/notebook.ipynb
89-
90- # ENV variables to replace conf file
91- ENV DEBUG=false \
92- GALAXY_WEB_PORT=10000 \
93- NOTEBOOK_PASSWORD=none \
94- CORS_ORIGIN=none \
95- DOCKER_PORT=none \
96- API_KEY=none \
97- HISTORY_ID=none \
98- REMOTE_HOST=none \
99- GALAXY_URL=none
100-
101- # @jupyterlab/google-drive not yet supported
57+ mamba clean --all -y
10258
10359USER root
10460
105- # R pre-requisites
106- RUN apt-get update --yes && \
107- apt-get install --yes --no-install-recommends \
108- fonts-dejavu \
109- unixodbc \
110- unixodbc-dev \
111- r-cran-rodbc \
112- gfortran \
113- net-tools \
114- procps \
115- libgl1 \
116- xvfb \
117- gcc && \
118- apt-get clean && rm -rf /var/lib/apt/lists/*
119-
120- # /import will be the universal mount-point for Jupyter
121- # The Galaxy instance can copy in data that needs to be present to the Jupyter webserver
122- RUN mkdir -p /import/jupyter/outputs/ && \
123- mkdir -p /import/jupyter/data && \
124- mkdir -p /import/jupyter/mount && \
125- mkdir /export/ && \
126- chown -R $NB_USER:users /home/$NB_USER/ /import /export/ && \
127- chmod -R 777 /home/$NB_USER/ /import /export/
128-
129- # #USER jovyan
130-
131- WORKDIR /import
61+ RUN chmod -R a+rw /opt/conda && chown -R ${NB_UID}:${NB_GID} /home/jovyan
13262
133- # Start Jupyter Notebook
134- CMD /startup.sh
63+ USER $NB_UID
0 commit comments