|
| 1 | +FROM jupyter/datascience-notebook:hub-1.5.0 |
| 2 | + |
| 3 | +LABEL maintainer="Vincent Prevosto <prevosto@mit.edu>" |
| 4 | + |
| 5 | +USER root |
| 6 | +# APT packages |
| 7 | +RUN apt update && \ |
| 8 | + apt install -y --no-install-recommends \ |
| 9 | + libgl1-mesa-glx \ |
| 10 | + datalad && \ |
| 11 | + apt clean && \ |
| 12 | + rm -rf /var/lib/apt/lists/* |
| 13 | + |
| 14 | +# copy repo |
| 15 | +WORKDIR /srv |
| 16 | +RUN git clone https://github.com/SpikeInterface/spikeinterface.git |
| 17 | + |
| 18 | +RUN fix-permissions $CONDA_DIR && \ |
| 19 | +fix-permissions /home/$NB_USER && \ |
| 20 | +fix-permissions /srv/spikeinterface |
| 21 | + |
| 22 | +#Switch to user |
| 23 | +USER $NB_UID |
| 24 | + |
| 25 | +# update Anaconda and install pip |
| 26 | +RUN conda update -y conda && \ |
| 27 | + conda install -y pip |
| 28 | + |
| 29 | +# Conda installs |
| 30 | +RUN conda config --set channel_priority flexible && \ |
| 31 | + conda install -y -c conda-forge nb_conda_kernels \ |
| 32 | + jupyter_contrib_nbextensions \ |
| 33 | + jupyterlab-git \ |
| 34 | + pynwb && \ |
| 35 | + conda clean -tipsy |
| 36 | + |
| 37 | +# Create environment |
| 38 | +RUN ln -s /srv/spikeinterface /home/$NB_USER/ |
| 39 | +WORKDIR /home/$NB_USER/spikeinterface/installation_tips/ |
| 40 | +RUN conda env create -f full_spikeinterface_environment_mac.yml |
| 41 | + |
| 42 | +# Make kernels available |
| 43 | +SHELL ["conda","run","-n","spikeinterface","/bin/bash","-c"] |
| 44 | +RUN conda install --quiet --yes ipykernel && \ |
| 45 | + conda install --quiet --yes -c conda-forge datalad && \ |
| 46 | + python -m ipykernel install --user --name spikeinterface --display-name "spikeinterface" && \ |
| 47 | + pip install jupytext dotenv |
| 48 | + |
| 49 | +# Configure git (required by datalad) |
| 50 | +WORKDIR /home/$NB_USER/spikeinterface/ |
| 51 | +RUN git config --global --add user.name "Jovyan" && \ |
| 52 | + git config --global --add user.email jovyan@example.net |
| 53 | + |
| 54 | +# Create "getting started" notebook in home directory |
| 55 | +WORKDIR /home/$NB_USER/spikeinterface/examples/getting_started/ |
| 56 | +RUN jupytext --to notebook plot_getting_started.py && \ |
| 57 | + cp ~/spikeinterface/examples/getting_started/plot_getting_started.ipynb ~/getting_started.ipynb |
| 58 | + |
| 59 | +# Make sure to switch back to user (avoid running ui containers as root) |
| 60 | +USER $NB_UID |
| 61 | +WORKDIR /home/$NB_USER |
0 commit comments