Dockerfile 2.27 KB
Newer Older
1
2
3
4
5
6
7
FROM jupyter/base-notebook:latest

USER root
WORKDIR /

# Debian packages
RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
Bas Nijholt's avatar
Bas Nijholt committed
8
9
10
11
        autossh \
        bash-completion \
        build-essential \
        cron \
Joseph Weston's avatar
Joseph Weston committed
12
        tree \
Bas Nijholt's avatar
Bas Nijholt committed
13
14
15
16
        curl \
        dvipng \
        gfortran \
        git \
Joseph Weston's avatar
Joseph Weston committed
17
        tig \
Bas Nijholt's avatar
Bas Nijholt committed
18
19
        htop \
        imagemagick \
Bas Nijholt's avatar
add jq    
Bas Nijholt committed
20
        jq \
Bas Nijholt's avatar
Bas Nijholt committed
21
22
23
24
25
26
        keychain \
        less \
        man \
        nano \
        rsync \
        screen \
Joseph Weston's avatar
Joseph Weston committed
27
        tmux \
Bas Nijholt's avatar
Bas Nijholt committed
28
29
        vim \
        zsh \
Rafal Skolasinski's avatar
Rafal Skolasinski committed
30
31
        openssh-server \
        apt-transport-https \
32
        gnupg \
33
34
35
36
37
38
39
   && apt-get clean \
   && rm -rf /var/lib/apt/lists/*

# Add global bash profile
COPY profile.sh /etc/profile.d/

# Add environment files
Rafal Skolasinski's avatar
Rafal Skolasinski committed
40
RUN mkdir /environments
41
COPY machine-learning.yml /environments/
42
43

# Update the root environment
44
RUN conda env update -n root -f /environments/machine-learning.yml
45

46
# Enable `jupyter nbextension`s
Bas Nijholt's avatar
Bas Nijholt committed
47
48
49
RUN jupyter nbextension enable --py --sys-prefix ipyparallel && \
    jupyter nbextension enable --py --sys-prefix jupyter_cms && \
    jupyter nbextension enable --py --sys-prefix jupyter_dashboards && \
50
    jupyter labextension install @jupyter-widgets/jupyterlab-manager \
51
            @jupyterlab/katex-extension \
Anton Akhmerov's avatar
Anton Akhmerov committed
52
            jupyterlab_bokeh @pyviz/jupyterlab_holoviews
53
54
55
56
57
58

# prevent nb_conda_kernels from overriding our custom kernel manager
RUN rm /opt/conda/etc/jupyter/jupyter_notebook_config.json

# Add notebook config
COPY jupyter_notebook_config.py /opt/conda/etc/jupyter
59

60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Register nbdime as a git diff and merge tool
COPY git* /etc/

# Create parallel profiles and copy the correct config
RUN ipython profile create --parallel --profile python3 --ipython-dir /opt/conda/etc/ipython
COPY ipcluster_config_python3.py /opt/conda/etc/ipython/profile_python3/ipcluster_config.py

# setting openblas and mkl variables
ENV OPENBLAS_NUM_THREADS=1\
    OMP_NUM_THREADS=1\
    MKL_DYNAMIC=FALSE\
    MKL_NUM_THREADS=1\
    CONDA_ALWAYS_COPY=true

74
75
76
# Cleanup all downloaded conda files
RUN conda clean --yes --all

77
78
79
# Fix permissions (required when following the base image)
RUN fix-permissions /opt/conda

Rafal Skolasinski's avatar
Rafal Skolasinski committed
80
# copy startup.sh script and set start-up command
Joseph Weston's avatar
Joseph Weston committed
81
82
COPY startup.sh /usr/local/bin
CMD ["startup.sh"]
83
EXPOSE 22
84
85
86

# Switch back to jovyan to avoid accidental container runs as root
USER $NB_UID