mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-17 15:02:57 +00:00
inherit pyspark from scipy-notebook
removes duplicate installation of python 2 env and Python packages. There are very few packages in scipy not in pyspark, so removing the duplicate seems valuable.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Copyright (c) Jupyter Development Team.
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
FROM jupyter/minimal-notebook
|
||||
FROM jupyter/scipy-notebook
|
||||
|
||||
MAINTAINER Jupyter Project <jupyter@googlegroups.com>
|
||||
|
||||
@@ -40,44 +40,3 @@ ENV MESOS_NATIVE_LIBRARY /usr/local/lib/libmesos.so
|
||||
ENV SPARK_OPTS --driver-java-options=-Xms1024M --driver-java-options=-Xmx4096M --driver-java-options=-Dlog4j.logLevel=info
|
||||
|
||||
USER $NB_USER
|
||||
|
||||
# Install Python 3 packages
|
||||
RUN conda install --quiet --yes \
|
||||
'ipywidgets=5.1*' \
|
||||
'pandas=0.17*' \
|
||||
'numexpr=2.5*' \
|
||||
'matplotlib=1.5*' \
|
||||
'scipy=0.17*' \
|
||||
'seaborn=0.7*' \
|
||||
'scikit-learn=0.17*' \
|
||||
jq \
|
||||
&& conda clean -tipsy
|
||||
# Activate ipywidgets extension in the environment that runs the notebook server
|
||||
RUN jupyter nbextension enable --py widgetsnbextension --sys-prefix
|
||||
|
||||
# Install Python 2 packages and kernel spec
|
||||
RUN conda create --quiet --yes -p $CONDA_DIR/envs/python2 python=2.7 \
|
||||
'ipython=4.2*' \
|
||||
'ipywidgets=5.1*' \
|
||||
'pandas=0.17*' \
|
||||
'numexpr=2.5*' \
|
||||
'matplotlib=1.5*' \
|
||||
'scipy=0.17*' \
|
||||
'seaborn=0.7*' \
|
||||
'scikit-learn=0.17*' \
|
||||
pyzmq \
|
||||
&& conda clean -tipsy
|
||||
# Add shortcuts to distinguish pip for python2 and python3 envs
|
||||
RUN ln -s $CONDA_DIR/envs/python2/bin/pip $CONDA_DIR/bin/pip2 && \
|
||||
ln -s $CONDA_DIR/bin/pip $CONDA_DIR/bin/pip3
|
||||
|
||||
# Install Python 2 kernel spec into the Python 3 conda environment which
|
||||
# runs the notebook server
|
||||
RUN bash -c '. activate python2 && \
|
||||
python -m ipykernel.kernelspec --prefix=$CONDA_DIR && \
|
||||
. deactivate'
|
||||
# Set PYSPARK_HOME in the python2 spec
|
||||
RUN jq --arg v "$CONDA_DIR/envs/python2/bin/python" \
|
||||
'.["env"]["PYSPARK_PYTHON"]=$v' \
|
||||
$CONDA_DIR/share/jupyter/kernels/python2/kernel.json > /tmp/kernel.json && \
|
||||
mv /tmp/kernel.json $CONDA_DIR/share/jupyter/kernels/python2/kernel.json
|
||||
|
Reference in New Issue
Block a user