diff --git a/scipy-notebook/Dockerfile b/scipy-notebook/Dockerfile index 54ca5292..3b4ebac8 100644 --- a/scipy-notebook/Dockerfile +++ b/scipy-notebook/Dockerfile @@ -74,6 +74,10 @@ RUN conda create --quiet --yes -p $CONDA_DIR/envs/python2 python=2.7 \ RUN ln -s $CONDA_DIR/envs/python2/bin/pip $CONDA_DIR/bin/pip2 && \ ln -s $CONDA_DIR/bin/pip $CONDA_DIR/bin/pip3 +# Import matplotlib the first time to build the font cache. +ENV XDG_CACHE_HOME /home/$NB_USER/.cache/ +RUN MPLBACKEND=Agg $CONDA_DIR/envs/python2/bin/python -c "import matplotlib.pyplot" + # Configure ipython kernel to use matplotlib inline backend by default RUN mkdir -p $HOME/.ipython/profile_default/startup COPY mplimporthook.py $HOME/.ipython/profile_default/startup/