44
55USER root
66
7- # Install all OS dependencies for fully functional notebook server
87ENV DEBIAN_FRONTEND noninteractive
9- RUN apt-get update && apt-get install -yq --no-install-recommends --fix-missing \
8+
9+ RUN REPO=http://cdn-fastly.deb.debian.org \
10+ && echo "deb $REPO/debian jessie main\n deb $REPO/debian-security jessie/updates main" > /etc/apt/sources.list \
11+ && apt-get update && apt-get -yq dist-upgrade \
12+ && apt-get install -yq --no-install-recommends --fix-missing \
1013 git \
1114 vim \
1215 jed \
@@ -30,7 +33,15 @@ RUN apt-get update && apt-get install -yq --no-install-recommends --fix-missing
3033 libav-tools \
3134 libmpich2-dev \
3235 liblapack-dev \
36+ freeglut3 \
3337 freeglut3-dev \
38+ libglew1.5 \
39+ libglew1.5-dev \
40+ libglu1-mesa \
41+ libglu1-mesa-dev \
42+ libgl1-mesa-glx \
43+ libgl1-mesa-dev \
44+ curl \
3445 libjpeg-dev \
3546 m4 \
3647 libssl-dev \
@@ -50,16 +61,21 @@ RUN apt-get update && apt-get install -yq --no-install-recommends --fix-missing
5061 binfmt-support \
5162 python3-dev \
5263 python3-wheel \
53- && apt-get clean
64+ libffi-dev \
65+ python-lzma \
66+ python-pip \
67+ cmake \
68+ gfortran \
69+ && apt-get clean \
70+ && rm -rf /var/lib/apt/lists/*
5471
55- RUN pip3 install notebook terminado
5672
5773RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
5874 locale-gen
5975
6076# Install Tini
61- RUN wget --quiet https://github.com/krallin/tini/releases/download/v0.9 .0/tini && \
62- echo "faafbfb5b079303691a939a747d7f60591f2143164093727e870b289a44d9872 *tini" | sha256sum -c - && \
77+ RUN wget --quiet https://github.com/krallin/tini/releases/download/v0.10 .0/tini && \
78+ echo "1361527f39190a7338a0b434bd8c88ff7233ce7b9a4876f3315c22fce7eca1b0 *tini" | sha256sum -c - && \
6379 mv tini /usr/local/bin/tini && \
6480 chmod +x /usr/local/bin/tini
6581
@@ -72,34 +88,29 @@ ENV LANG en_US.UTF-8
7288ENV LANGUAGE en_US.UTF-8
7389
7490# Create jovyan user with UID=1000 and in the 'users' group
75- RUN useradd -m -s /bin/bash -N -u $NB_UID $NB_USER && \
76- chown -R $NB_USER:users /home/$NB_USER
91+ RUN useradd -m -s /bin/bash -N -u $NB_UID $NB_USER
7792
78- USER jovyan
93+ RUN mkdir /home/$NB_USER/.jupyter && \
94+ mkdir /home/$NB_USER/.local && \
95+ mkdir /home/$NB_USER/.hashdist && \
96+ echo "cacert=/etc/ssl/certs/ca-certificates.crt" > /home/$NB_USER/.curlrc
7997
80- RUN mkdir /home/$NB_USER/work && \
81- mkdir /home/$NB_USER/.jupyter && \
82- mkdir /home/$NB_USER/.local
98+ ADD https://dl.dropboxusercontent.com/u/26353144/hashdist_config_jovyan.yaml /home/$NB_USER/.hashdist/config.yaml
8399
84- # RUN wget https://dl.dropboxusercontent.com/u/26353144/hashdist_config_jovyan.yaml && \
85- # mkdir /home/$NB_USER/.hashdist && \
86- # mv hashdist_config_jovyan.yaml /home/$NB_USER/.hashdist/config.yaml && \
87- # cat /home/$NB_USER/.hashdist/config.yaml
100+ RUN chown -R $NB_USER:users /home/$NB_USER
88101
89- WORKDIR /home/$NB_USER
102+ USER jovyan
103+
104+ RUN ls /home/$NB_USER/.hashdist && \
105+ cat /home/$NB_USER/.hashdist/config.yaml
90106
91- RUN git clone https://github.com/erdc-cm/workshops -b erdc-fsi-tutorials
107+ WORKDIR /home/$NB_USER
92108
93- RUN git clone https://github.com/erdc-cm/proteus && \
109+ RUN cat /home/$NB_USER/.hashdist/config.yaml && \
110+ git clone https://github.com/erdc-cm/proteus && \
94111 cd proteus && \
95112 make hashdist stack stack/default.yaml && \
96113 cd stack && \
97- git remote add erdc-cm http://github.com/erdc-cm/hashstack-private && \
98- git fetch --all && \
99- git checkout erdc-cm/cekees/kitchen_sink && \
100- /usr/bin/mpicc -show && \
101- which mpiexec && \
102- which mpirun && \
103114 ../hashdist/bin/hit build default.yaml -v
104115
105116ENV CC mpicc
@@ -112,54 +123,55 @@ RUN cd proteus && make develop
112123ENV PATH /home/$NB_USER/proteus/linux2/bin:$PATH
113124ENV LD_LIBRARY_PATH /home/$NB_USER/proteus/linux2/lib:$LD_LIBRARY_PATH
114125
126+ RUN cd proteus && make jupyter
127+
115128USER root
116129
117- # Configure container startup as root
130+ RUN pip3 install pyzmq --install-option="--zmq=/home/$NB_USER/proteus/linux2"
131+ RUN pip3 install notebook jupyterhub jupyterlab terminado ipyparallel ipywidgets ipyleaflet jupyter_dashboards pythreejs cesiumpy
132+ RUN /usr/local/bin/jupyter serverextension enable --py jupyterlab --sys-prefix \
133+ && /usr/local/bin/jupyter nbextension enable --py --sys-prefix widgetsnbextension \
134+ && /usr/local/bin/jupyter nbextension enable --py --sys-prefix pythreejs \
135+ && /usr/local/bin/jupyter nbextension enable --py --sys-prefix ipyleaflet \
136+ && /usr/local/bin/jupyter dashboards quick-setup --sys-prefix
137+
118138EXPOSE 8888
119- WORKDIR /home/$NB_USER/work
139+ WORKDIR /home/$NB_USER
140+
120141ENTRYPOINT ["tini" , "--" ]
121142CMD ["start-notebook.sh" ]
122143
123- RUN cd /usr/local/bin && \
124- wget https://raw.githubusercontent.com/jupyter/docker-stacks/master/minimal-notebook/start-notebook.sh
144+ # Add local files as late as possible to avoid cache busting
145+ ADD https://raw.githubusercontent.com/jupyter/docker-stacks/master/base-notebook/start.sh /usr/local/bin/start.sh
146+ ADD https://raw.githubusercontent.com/jupyter/docker-stacks/master/base-notebook/start-notebook.sh /usr/local/bin/start-notebook.sh
147+ ADD https://raw.githubusercontent.com/jupyter/docker-stacks/master/base-notebook/start-singleuser.sh /usr/local/bin/start-singleuser.sh
148+ ADD https://raw.githubusercontent.com/jupyter/docker-stacks/master/base-notebook/jupyter_notebook_config.py /home/$NB_USER/.jupyter/jupyter_notebook_config.py
125149
126- ADD https://raw.githubusercontent.com/jupyter/docker-stacks/master/minimal-notebook/jupyter_notebook_config.py /home/$NB_USER/.jupyter/jupyter_notebook_config.py
150+ RUN chmod a+rx /usr/local/bin/*
127151
128- RUN mkdir /etc/jupyter && \
129- chmod a+rwX /etc/jupyter && \
130- chown -R $NB_USER:users /home/$NB_USER
152+ RUN chown -R $NB_USER:users /home/$NB_USER/.jupyter
131153
132- # jupyter/ipython extensions
133- RUN pip3 install \
134- ipyparallel \
135- ipywidgets
154+ RUN jupyter kernelspec install-self
136155
137156# Switch back to jovyan to avoid accidental container runs as root
138- USER jovyan
139-
157+ USER $NB_USER
158+
140159RUN cd ~/.jupyter && \
141160 ipython profile create mpi --parallel && \
142- ipcluster nbextension enable && \
161+ ipcluster nbextension enable --user && \
143162 echo '\n c.NotebookApp.server_extensions.append("ipyparallel.nbextension")' >> /home/$NB_USER/.jupyter/jupyter_notebook_config.py && \
144- cp jupyter_notebook_config.py /etc/jupyter/ && \
145163 echo "c.LocalControllerLauncher.controller_cmd = ['python2', '-m', 'ipyparallel.controller']\n c.LocalEngineSetLauncher.engine_cmd = ['python2', '-m', 'ipyparallel.engine']\n " \
146- >> /home/$NB_USER/.ipython/profile_mpi/ipcluster_config.py
147-
148- USER root
149-
150- RUN jupyter kernelspec install-self
151-
152- # fetch juptyerhub-singleuser entrypoint
153- RUN wget -q https://raw.githubusercontent.com/jupyter/jupyterhub/master/scripts/jupyterhub-singleuser -O /usr/local/bin/jupyterhub-singleuser && \
154- chmod 755 /usr/local/bin/jupyterhub-singleuser
155-
156- ADD https://raw.githubusercontent.com/jupyter/dockerspawner/master/singleuser/singleuser.sh /srv/singleuser/singleuser.sh
157-
158- RUN chmod 755 /srv/singleuser/singleuser.sh
159-
160- USER jovyan
161-
162- RUN cat /srv/singleuser/singleuser.sh
163- # smoke test that it's importable at least
164- RUN sh /srv/singleuser/singleuser.sh -h
165- CMD ["sh" , "/srv/singleuser/singleuser.sh" ]
164+ >> /home/$NB_USER/.ipython/profile_mpi/ipcluster_config.py \
165+ && jupyter serverextension enable --py jupyterlab --user \
166+ && jupyter nbextension enable --py --user widgetsnbextension\
167+ && jupyter nbextension install --py --user mayavi \
168+ && jupyter nbextension enable --py --user bqplot \
169+ && jupyter nbextension enable --py --user pythreejs \
170+ && jupyter nbextension enable --py --user ipyleaflet \
171+ && jupyter nbextension install --py --user rise \
172+ && jupyter nbextension enable --py --user rise \
173+ && jupyter dashboards quick-setup --user
174+
175+ # Import matplotlib the first time to build the font cache.
176+ ENV XDG_CACHE_HOME /home/$NB_USER/.cache/
177+ RUN MPLBACKEND=Agg python -c "import matplotlib.pyplot"
0 commit comments