Skip to content

Instantly share code, notes, and snippets.

@TKCen
Last active October 5, 2016 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TKCen/d9e33a1e475f91d684adfbe935446a74 to your computer and use it in GitHub Desktop.
Save TKCen/d9e33a1e475f91d684adfbe935446a74 to your computer and use it in GitHub Desktop.
Analytics jupyterhub notebook server with anaconda issues
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
# Modified by Sebastian Haenisch
# Pin to version of notebook image that includes start-singleuser.sh script
FROM jupyter/scipy-notebook:28515ed64e5e
USER root
RUN apt-get update
RUN apt-get install libpq-dev python-dev -y
# Do the pip installs as the unprivileged notebook user
USER jovyan
# Install Anaconda
RUN conda install anaconda -y
RUN conda uninstall nb_anacondacloud -y
# Install dashboard layout and preview within Jupyter Notebook
RUN pip install jupyter_dashboards && \
jupyter dashboards quick-setup --sys-prefix
# Install declarative widgets for Jupyter Notebook
RUN pip install jupyter_declarativewidgets && \
jupyter declarativewidgets quick-setup --sys-prefix
# Install content management to support dashboard bundler options
RUN pip install jupyter_cms && \
jupyter cms quick-setup --sys-prefix
RUN pip install jupyter_dashboards_bundlers && \
jupyter dashboards_bundlers quick-setup --sys-prefix
#Install Jupyter Lab
USER jovyan
RUN pip install jupyterlab && \
jupyter serverextension enable --py jupyterlab
# Install RISE
USER jovyan
RUN pip install RISE && \
jupyter-nbextension install rise --py --sys-prefix && \
jupyter-nbextension enable rise --py --sys-prefix
# Install nbextensions_configurator
USER jovyan
RUN pip install jupyter_nbextensions_configurator
RUN jupyter nbextensions_configurator enable --user
RUN conda install -c conda-forge jupyter_contrib_nbextensions -y
# Install packages in default Python 3 environment
USER jovyan
RUN pip install \
beautifulsoup4 \
psycopg2 \
sqlalchemy-redshift \
yapf
# Install packages in Python 2 environment
RUN $CONDA_DIR/envs/python2/bin/pip install \
beautifulsoup4 \
psycopg2 \
sqlalchemy-redshift \
yapf
# Use custom startup script
USER root
COPY docker-entrypoint.sh /srv/docker-entrypoint.sh
ENTRYPOINT ["tini", "--", "/srv/docker-entrypoint.sh"]
CMD ["start-singleuser.sh"]
USER jovyan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment