This repository has been archived by the owner on Feb 1, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile
66 lines (53 loc) · 2.78 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM ubuntu:16.04
MAINTAINER Martin Durant <martin.durant@utoronto.ca>
RUN apt-get update -yqq && apt-get install -yqq bzip2 git wget graphviz && rm -rf /var/lib/apt/lists/*
# Configure environment
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN mkdir -p /work/bin
# Install Python 3 from miniconda
ADD https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh miniconda.sh
RUN bash miniconda.sh -b -p /work/miniconda && rm miniconda.sh
# keep conda in user dir, so can do conda install in notebook
ENV PATH="/work/bin:/work/miniconda/bin:$PATH"
# Install pydata stack
RUN conda config --set always_yes yes --set changeps1 no --set auto_update_conda no
RUN conda install notebook psutil numpy pandas scikit-learn statsmodels pip numba \
scikit-image datashader holoviews nomkl matplotlib lz4 tornado
RUN conda install -c conda-forge fastparquet s3fs zict python-blosc cytoolz dask distributed dask-searchcv gcsfs \
&& conda clean -tipsy \
&& pip install git+https://github.com/dask/dask-glm.git --no-deps\
&& pip install graphviz
RUN conda install -c conda-forge nodejs
RUN conda install -c conda-forge jupyterlab jupyter_dashboards ipywidgets \
&& jupyter labextension install @jupyter-widgets/jupyterlab-manager \
&& jupyter nbextension enable jupyter_dashboards --py --sys-prefix \
&& jupyter nbextension enable widgetsnbextension --py --sys-prefix \
&& conda clean -tipsy
RUN conda install -c bokeh bokeh \
&& jupyter labextension install jupyterlab_bokeh \
&& conda clean -tipsy \
&& npm cache clean --force
# Optional: Install the master branch of distributed and dask
RUN pip install git+https://github.com/dask/dask --upgrade --no-deps \
&& pip install git+https://github.com/dask/distributed --upgrade --no-deps \
&& pip install git+https://github.com/dask/gcsfs --upgrade \
&& pip install git+https://github.com/pydata/xarray --upgrade \
&& pip install git+https://github.com/zarr-developers/zarr --upgrade
# Install Tini that necessary to properly run the notebook service in docker
# http://jupyter-notebook.readthedocs.org/en/latest/public_server.html#docker-cmd
ENV TINI_VERSION v0.9.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
# for further interaction with kubernetes
ADD https://storage.googleapis.com/kubernetes-release/release/v1.5.4/bin/linux/amd64/kubectl /usr/sbin/kubectl
RUN chmod +x /usr/bin/tini && chmod 0500 /usr/sbin/kubectl
# Add local files at the end of the Dockerfile to limit cache busting
COPY config /work/config
COPY examples /work/examples
ENTRYPOINT ["/usr/bin/tini", "--"]
# Create a non-priviledge user that will run the client and workers
ENV BASICUSER basicuser
ENV BASICUSER_UID 1000
RUN useradd -m -d /work -s /bin/bash -N -u $BASICUSER_UID $BASICUSER \
&& chown $BASICUSER /work \
&& chown $BASICUSER:users -R /work