1
- # Econometrics Book Base Docker Image (for tmpnb orchestrate.py server)
2
- # User: econ
1
+ # Econometrics Book Docker Image
2
+ # User: jovyan
3
+ # This uses the Jupyter DataScience Docker Container with Python, R and Julia
3
4
4
- FROM debian:jessie
5
+ FROM jupyter/datascience-notebook
5
6
6
7
MAINTAINER Matthew McKay <mamckay@gmail.com>
7
8
8
- # Install all OS dependencies for fully functional notebook server
9
- ENV DEBIAN_FRONTEND noninteractive
10
- RUN apt-get update && apt-get install -yq --no-install-recommends \
11
- git \
12
- vim \
13
- wget \
14
- build-essential \
15
- python-dev \
16
- ca-certificates \
17
- bzip2 \
18
- unzip \
19
- libsm6 \
20
- pandoc \
21
- texlive-latex-base \
22
- texlive-latex-extra \
23
- texlive-fonts-extra \
24
- texlive-fonts-recommended \
25
- supervisor \
26
- sudo \
27
- && apt-get clean
28
-
29
- # Julia dependencies
30
- RUN apt-get install -y julia libnettle4 && apt-get clean
31
-
32
- # R dependencies that conda can't provide (X, fonts, compilers)
33
- RUN apt-get install -y libzmq3-dev libcurl4-openssl-dev libxrender1 fonts-dejavu gfortran gcc && apt-get clean
34
-
35
- ENV CONDA_DIR /opt/conda
36
-
37
- # Install conda
38
- RUN echo 'export PATH=$CONDA_DIR/bin:$PATH' > /etc/profile.d/conda.sh && \
39
- wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
40
- /bin/bash Miniconda3-latest-Linux-x86_64.sh -b -p $CONDA_DIR && \
41
- rm Miniconda3-latest-Linux-x86_64.sh && \
42
- $CONDA_DIR/bin/conda install --yes python=3.5 anaconda && $CONDA_DIR/bin/conda clean -yt
43
-
44
- # We run our docker images with a non-root user as a security precaution.
45
- # econ is our user
46
- RUN useradd -m -s /bin/bash econ
47
- RUN chown -R econ:econ $CONDA_DIR
48
-
49
- EXPOSE 8888
50
-
51
- USER econ
52
- ENV HOME /home/econ
53
- ENV SHELL /bin/bash
54
- ENV USER econ
55
- ENV PATH $CONDA_DIR/bin:$PATH
56
- WORKDIR $HOME
57
-
58
- RUN conda install --yes ipython-notebook terminado && conda clean -yt
59
-
60
- RUN ipython profile create
61
-
62
- # Workaround for issue with ADD permissions
63
9
USER root
64
- ADD notebooks/ /home/econ/
65
- RUN chown econ:econ /home/econ -R
66
- USER econ
67
-
68
- # Python packages
69
- RUN conda install --yes python=3.5 anaconda && conda clean -yt
70
- RUN pip install quantecon
71
10
72
- # Now for a python2 environment
73
- # RUN conda create -p $CONDA_DIR/envs/python2 python=2.7 ipython numpy pandas scikit-learn scikit-image matplotlib scipy seaborn sympy cython patsy statsmodels cloudpickle dill numba bokeh && conda clean -yt
74
- # RUN $CONDA_DIR/envs/python2/bin/python $CONDA_DIR/envs/python2/bin/ipython kernelspec install-self --user
75
- # RUN source activate python2 && pip install quantecon && source deactivate python2
11
+ # -Add Notebooks-#
12
+ ADD notebooks/ /home/jovyan/work/
76
13
77
- # R packages
78
- RUN conda config --add channels r
79
- RUN conda install --yes r-irkernel r-plyr r-devtools r-rcurl r-dplyr r-ggplot2 r-caret rpy2 r-tidyr r-shiny r-rmarkdown r-forecast r-stringr r-rsqlite r-reshape2 r-nycflights13 r-randomforest && conda clean -yt
80
-
81
- # IJulia and Julia packages
82
- RUN julia -e 'Pkg.add("IJulia")'
83
- # RUN julia -e 'Pkg.add("PyPlot")' && julia -e 'Pkg.add("Distributions")' && julia -e 'Pkg.add("KernelEstimator")'
84
- # julia -e 'Pkg.add("Gadfly")' && julia -e 'Pkg.add("RDatasets")' &&
85
-
86
- # Add Templates
87
- USER root
88
- ADD profile_default /home/econ/.ipython/profile_default
14
+ # -Add Templates-#
15
+ ADD jupyter_notebook_config.py /home/jovyan/.jupyter/
89
16
ADD templates/ /srv/templates/
90
17
RUN chmod a+rX /srv/templates
91
- USER econ
92
18
93
- # Convert notebooks to the current format
94
- RUN find /home/. -name '*.ipynb' -exec ipython nbconvert --to notebook {} --output {} \;
95
- RUN find /home/. -name '*.ipynb' -exec ipython trust {} \;
19
+ # - Convert notebooks to the current format-#
20
+ RUN find /home/. -name '*.ipynb' -exec jupyter nbconvert --to notebook {} --output {} \;
21
+ RUN find /home/. -name '*.ipynb' -exec jupyter trust {} \;
96
22
97
- CMD ipython notebook
23
+ USER jovyan
0 commit comments