2015-05-21 13:02:38 +08:00
|
|
|
# Installs Jupyter Notebook and IPython kernel from the current branch
|
|
|
|
# Another Docker container should inherit with `FROM jupyter/notebook`
|
|
|
|
# to run actual services.
|
2016-02-27 13:35:32 +08:00
|
|
|
#
|
|
|
|
# For opinionated stacks of ready-to-run Jupyter applications in Docker,
|
|
|
|
# check out docker-stacks <https://github.com/jupyter/docker-stacks>
|
2014-09-13 01:38:36 +08:00
|
|
|
|
2016-01-29 10:30:25 +08:00
|
|
|
FROM jupyter/ubuntu_14_04_locale_fix
|
2014-09-13 00:46:41 +08:00
|
|
|
|
2015-05-21 13:02:38 +08:00
|
|
|
MAINTAINER Project Jupyter <jupyter@googlegroups.com>
|
2014-09-13 00:46:41 +08:00
|
|
|
|
2014-09-25 10:49:27 +08:00
|
|
|
# Not essential, but wise to set the lang
|
|
|
|
# Note: Users with other languages should set this in their derivative image
|
|
|
|
ENV LANGUAGE en_US.UTF-8
|
|
|
|
ENV LANG en_US.UTF-8
|
|
|
|
ENV LC_ALL en_US.UTF-8
|
2015-10-08 12:35:59 +08:00
|
|
|
ENV PYTHONIOENCODING UTF-8
|
2014-09-25 10:49:27 +08:00
|
|
|
|
2015-10-11 04:12:13 +08:00
|
|
|
# Remove preinstalled copy of python that blocks our ability to install development python.
|
2015-10-09 08:15:24 +08:00
|
|
|
RUN DEBIAN_FRONTEND=noninteractive apt-get remove -yq \
|
|
|
|
python3-minimal \
|
|
|
|
python3.4 \
|
|
|
|
python3.4-minimal \
|
|
|
|
libpython3-stdlib \
|
|
|
|
libpython3.4-stdlib \
|
|
|
|
libpython3.4-minimal
|
|
|
|
|
2015-10-06 02:36:54 +08:00
|
|
|
# Python binary and source dependencies
|
2015-10-07 23:58:25 +08:00
|
|
|
RUN apt-get update -qq && \
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
|
2015-10-02 07:12:50 +08:00
|
|
|
build-essential \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
git \
|
|
|
|
language-pack-en \
|
|
|
|
libcurl4-openssl-dev \
|
2015-10-11 05:42:36 +08:00
|
|
|
libffi-dev \
|
2015-10-02 07:12:50 +08:00
|
|
|
libsqlite3-dev \
|
|
|
|
libzmq3-dev \
|
|
|
|
pandoc \
|
|
|
|
python \
|
2015-10-11 04:14:07 +08:00
|
|
|
python3 \
|
2015-10-02 07:12:50 +08:00
|
|
|
python-dev \
|
|
|
|
python3-dev \
|
|
|
|
sqlite3 \
|
2015-10-06 03:59:38 +08:00
|
|
|
texlive-fonts-recommended \
|
|
|
|
texlive-latex-base \
|
|
|
|
texlive-latex-extra \
|
2015-10-07 23:58:25 +08:00
|
|
|
zlib1g-dev && \
|
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2015-05-21 13:02:38 +08:00
|
|
|
|
2015-10-07 01:17:51 +08:00
|
|
|
# Install Tini
|
|
|
|
RUN curl -L https://github.com/krallin/tini/releases/download/v0.6.0/tini > tini && \
|
|
|
|
echo "d5ed732199c36a1189320e6c4859f0169e950692f451c03e7854243b95f4234b *tini" | sha256sum -c - && \
|
|
|
|
mv tini /usr/local/bin/tini && \
|
|
|
|
chmod +x /usr/local/bin/tini
|
|
|
|
|
2015-10-07 23:58:25 +08:00
|
|
|
# Install the recent pip release
|
|
|
|
RUN curl -O https://bootstrap.pypa.io/get-pip.py && \
|
|
|
|
python2 get-pip.py && \
|
|
|
|
python3 get-pip.py && \
|
2015-10-11 05:42:36 +08:00
|
|
|
rm get-pip.py && \
|
|
|
|
pip2 --no-cache-dir install requests[security] && \
|
2015-10-11 04:54:22 +08:00
|
|
|
pip3 --no-cache-dir install requests[security] && \
|
|
|
|
rm -rf /root/.cache
|
2015-10-07 23:58:25 +08:00
|
|
|
|
|
|
|
# Install some dependencies.
|
|
|
|
RUN pip2 --no-cache-dir install ipykernel && \
|
|
|
|
pip3 --no-cache-dir install ipykernel && \
|
|
|
|
\
|
|
|
|
python2 -m ipykernel.kernelspec && \
|
2015-10-11 04:54:22 +08:00
|
|
|
python3 -m ipykernel.kernelspec && \
|
|
|
|
rm -rf /root/.cache
|
2015-10-07 23:58:25 +08:00
|
|
|
|
|
|
|
# Move notebook contents into place.
|
2015-10-06 03:08:21 +08:00
|
|
|
ADD . /usr/src/jupyter-notebook
|
2014-09-25 06:32:15 +08:00
|
|
|
|
2015-10-07 23:58:25 +08:00
|
|
|
# Install dependencies and run tests.
|
|
|
|
RUN BUILD_DEPS="nodejs-legacy npm" && \
|
|
|
|
apt-get update -qq && \
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -yq $BUILD_DEPS && \
|
|
|
|
\
|
2016-01-20 21:00:39 +08:00
|
|
|
pip3 install --no-cache-dir /usr/src/jupyter-notebook && \
|
2016-03-05 01:45:44 +08:00
|
|
|
pip2 install --no-cache-dir widgetsnbextension && \
|
|
|
|
pip3 install --no-cache-dir widgetsnbextension && \
|
2015-10-07 23:58:25 +08:00
|
|
|
\
|
2015-10-11 05:17:41 +08:00
|
|
|
npm cache clean && \
|
2015-10-07 23:58:25 +08:00
|
|
|
apt-get clean && \
|
2015-10-11 05:30:58 +08:00
|
|
|
rm -rf /root/.npm && \
|
2015-10-11 04:54:22 +08:00
|
|
|
rm -rf /root/.cache && \
|
2015-10-11 05:52:09 +08:00
|
|
|
rm -rf /root/.config && \
|
2015-10-11 05:53:18 +08:00
|
|
|
rm -rf /root/.local && \
|
2015-10-11 08:17:41 +08:00
|
|
|
rm -rf /root/tmp && \
|
2015-10-07 23:58:25 +08:00
|
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
|
|
apt-get purge -y --auto-remove \
|
|
|
|
-o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $BUILD_DEPS
|
|
|
|
|
|
|
|
# Run tests.
|
2016-02-06 00:40:44 +08:00
|
|
|
RUN pip3 install --no-cache-dir notebook[test] && nosetests -v notebook
|
2015-10-02 05:24:18 +08:00
|
|
|
|
2015-10-12 21:18:39 +08:00
|
|
|
# Add a notebook profile.
|
|
|
|
RUN mkdir -p -m 700 /root/.jupyter/ && \
|
|
|
|
echo "c.NotebookApp.ip = '*'" >> /root/.jupyter/jupyter_notebook_config.py
|
|
|
|
|
2015-10-06 03:16:00 +08:00
|
|
|
VOLUME /notebooks
|
|
|
|
WORKDIR /notebooks
|
|
|
|
|
2015-10-02 05:24:18 +08:00
|
|
|
EXPOSE 8888
|
2015-10-07 23:58:25 +08:00
|
|
|
|
2015-10-07 01:17:51 +08:00
|
|
|
ENTRYPOINT ["tini", "--"]
|
2016-04-14 04:32:15 +08:00
|
|
|
CMD ["jupyter", "notebook", "--no-browser"]
|