Skip to content

Commit 112043a

Browse files
20160710
1 parent 0ca2072 commit 112043a

22 files changed

+6406
-174
lines changed

Dockerfile

Lines changed: 72 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ RUN apt-get update && apt-get install -yq --no-install-recommends \
1818
bzip2 unzip \
1919
libsm6 \
2020
sudo locales \
21+
locate \
2122
libxrender1 default-jdk \
2223
&& apt-get clean && \
2324
rm -rf /var/lib/apt/lists/*
@@ -41,7 +42,6 @@ RUN dpkg-reconfigure locales
4142
# password: Password1
4243
# You can create your own account by entering the bash shell and creating your own user account or
4344
# change "jupyterhub" and "Password1" below.
44-
#RUN adduser --gecos "" jupyterhub && \
4545
RUN useradd -m -s $SHELL -N -u $NB_UID $NB_USER && \
4646
echo jupyterhub:Password1 | chpasswd
4747
RUN echo "cacert=/etc/ssl/certs/ca-certificates.crt" > /home/$NB_USER/.curlrc
@@ -74,28 +74,34 @@ RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 0527A9B7 && \
7474
RUN chmod +x /tini
7575

7676
RUN apt-get update
77-
RUN apt-get install -y python-dev python3-dev npm python-pip python3-pip nodejs-legacy
77+
RUN apt-get install -y python-dev python3-dev npm python-pip python3-pip nodejs-legacy virtualenv pypy
78+
RUN apt-get install -y libzmq3 libzmq3-dev python3-zmq
7879

79-
# configure Python virtual environments
80+
# use bash
8081
RUN ln -snf /bin/bash /bin/sh
81-
RUN pip install virtualenv && \
82-
pip3 install virtualenv
8382

84-
RUN virtualenv --system-site-packages -p /usr/bin/python2 venv27 && \
85-
source venv27/bin/activate && \
86-
pip install notebook ipykernel requests terminado && \
87-
ipython kernelspec install-self && \
83+
# configure Python virtual environments
84+
RUN virtualenv --system-site-packages -p /usr/bin/pypy /vepypy && \
85+
source /vepypy/bin/activate && \
86+
pip install --upgrade setuptools jupyter ipykernel requests pyzmq terminado jupyter_contrib_core && \
87+
ipython kernel install --name vepypy --display-name "Python-PyPy 2.7" && \
88+
deactivate
89+
90+
RUN virtualenv --system-site-packages -p /usr/bin/python2 /venv27 && \
91+
source /venv27/bin/activate && \
92+
pip install --upgrade setuptools jupyter ipykernel requests terminado jupyter_contrib_core && \
93+
ipython kernel install --name python2 --display-name "Python 2.7" && \
8894
deactivate
8995

90-
RUN virtualenv --system-site-packages -p /usr/bin/python3 venv35 && \
91-
source venv35/bin/activate && \
92-
pip3 install notebook ipykernel requests terminado && \
93-
ipython3 kernelspec install-self && \
96+
RUN virtualenv --system-site-packages -p /usr/bin/python3 /venv35 && \
97+
source /venv35/bin/activate && \
98+
pip3 install --upgrade setuptools jupyter ipykernel requests terminado jupyter_contrib_core && \
99+
ipython kernel install --name python3 --display-name "Python 3.5" && \
94100
deactivate
95101

96102
RUN npm install -g configurable-http-proxy && \
97103
pip3 install jupyterhub && \
98-
pip3 install jupyter && \
104+
pip3 install jupyter jupyter_core jupyter_contrib_core && \
99105
mkdir -p /etc/jupyterhub && \
100106
mkdir -p /root/work
101107
COPY etc/jupyterhub_config.py /etc/jupyterhub/
@@ -105,33 +111,19 @@ COPY stopjupyterhub.sh /root/work
105111
RUN mkdir -p /var/log/jupyterhub
106112
RUN touch /var/log/jupyterhub/jupyterhub.log
107113

108-
## Install R
109-
RUN mkdir -p /usr/local/lib/R/site-library && \
110-
chmod -R a+w /usr/local/lib/R/site-library
111-
112-
RUN echo 'deb http://cran.rstudio.com/bin/linux/ubuntu trusty/' >> /etc/apt/sources.list && \
113-
echo "options(repos = c(CRAN = 'http://cran.us.r-project.org'))" > /etc/Rprofile.site
114-
115-
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
116-
RUN apt-get update -y && \
117-
apt-get install -y r-base r-base-dev r-base-core
118-
114+
# Install Bash shell
115+
# http://datascienceatthecommandline.com/#tools
116+
RUN pip2 install bash_kernel && \
117+
pip3 install bash_kernel && \
118+
python3 -m bash_kernel.install
119+
RUN pip3 install awscli bigmler csvkit
119120
RUN apt-get update && \
120-
apt-get -y build-dep libcurl4-gnutls-dev && \
121-
apt-get -y install libcurl4-gnutls-dev libzmq3-dev r-cran-rjava r-cran-rodbc curl swig sqlite3
122-
123-
RUN R -e "install.packages('RCurl', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
124-
R -e "install.packages('curl', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
125-
R -e "install.packages('httr', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
126-
R -e "install.packages('devtools', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
127-
R -e "install.packages('repr', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
128-
R -e "install.packages('base64enc', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
129-
R -e "install.packages('evaluate', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
130-
R -e "install.packages('uuid', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
131-
R -e "install.packages(c('rzmq', 'IRkernel','IRdisplay'), repos = 'http://irkernel.github.io/', type = 'source')" && \
132-
R -e "IRkernel::installspec(user=FALSE)"
121+
apt-get install -y cowsay mawk bc feedgnuplot findutils less parallel tree curl && \
122+
echo "export PATH=$PATH:/usr/games" >> /etc/profile && \
123+
echo "export PATH=$PATH:/usr/games" >> /home/jupyterhub/.bashrc
124+
RUN npm install xml2json-command
133125

134-
# Install Scale 2.11
126+
# Install Scala 2.11
135127
# Based on https://github.com/alexarchambault/jupyter-scala
136128
# Initial launch in notebook takes a while due to launcher downloading additional libraries
137129
# util.Properties.versionString
@@ -152,12 +144,41 @@ RUN apt-add-repository ppa:brightbox/ruby-ng --yes && \
152144
RUN apt-get install -y ruby2.2 ruby2.2-dev libtool-bin libmagickwand-dev imagemagick bundler gnuplot \
153145
libgsl0-dev zlib1g-dev libatlas-base-dev
154146
RUN apt-get install -y libblas-dev checkinstall && \
155-
apt-get install -y liblapacke-dev checkinstall
147+
apt-get install -y liblapacke-dev checkinstall autoconf automake
156148
RUN gem install erector bundler gnuplot
157149
RUN gem install sciruby-full
158150
# iruby register creates the kernel.json and kernelspec install makes it visible to jupyter
159151
RUN iruby register --force && \
160-
jupyter kernelspec install /root/.ipython/kernels/ruby
152+
ipython kernelspec install /root/.ipython/kernels/ruby
153+
154+
## Install R
155+
RUN mkdir -p /usr/local/lib/R/site-library && \
156+
chmod -R a+w /usr/local/lib/R/site-library
157+
158+
RUN echo 'deb http://cran.rstudio.com/bin/linux/ubuntu trusty/' >> /etc/apt/sources.list && \
159+
echo "options(repos = c(CRAN = 'http://cran.us.r-project.org'))" > /etc/Rprofile.site
160+
161+
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
162+
RUN apt-get update -y && \
163+
apt-get install -y r-base r-base-dev r-base-core
164+
165+
RUN apt-get update && \
166+
apt-get -y build-dep libcurl4-gnutls-dev && \
167+
apt-get -y install libcurl4-gnutls-dev libzmq3-dev r-cran-rjava r-cran-rodbc swig sqlite3 libssh2-1-dev
168+
169+
RUN R -e "install.packages('RCurl', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
170+
R -e "install.packages('curl', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
171+
R -e "install.packages('httr', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
172+
R -e "install.packages('devtools', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
173+
R -e "install.packages('repr', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
174+
R -e "install.packages('base64enc', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
175+
R -e "install.packages('evaluate', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
176+
R -e "install.packages('uuid', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
177+
R -e "install.packages('rzmq', repos = 'http://irkernel.github.io/', type = 'source')"
178+
RUN R -e "install.packages(c('IRkernel','IRdisplay'), repos = 'http://irkernel.github.io/', type = 'source')" && \
179+
R -e "IRkernel::installspec(user=FALSE)"
180+
181+
RUN apt-get install -y libyaml-dev
161182

162183
# Backup local files to container image
163184
COPY etc/ /root/work/.backup/
@@ -184,13 +205,18 @@ RUN chmod a+w -R /home/$NB_USER
184205
RUN chmod a+x /home/$NB_USER/*.sh
185206
RUN chmod a+x /home/$NB_USER/packages/*.sh
186207

187-
# Install Python and R packages
188-
#RUN bash /home/jupyterhub/packages/python-packages.sh
189-
#RUN bash /home/jupyterhub/packages/python-gis-packages.sh
190-
#RUN bash /home/jupyterhub/packages/python-nlp-packages.sh
191-
#RUN bash /home/jupyterhub/packages/r-packages.sh
208+
# Install Python, R and notebook extension packages
209+
# RUN bash /home/jupyterhub/packages/python-packages.sh
210+
# RUN bash /home/jupyterhub/packages/python-gis-packages.sh
211+
# RUN bash /home/jupyterhub/packages/python-nlp-packages.sh
212+
# RUN bash /home/jupyterhub/packages/r-packages.sh
213+
# RUN bash /home/jupyterhub/packages/r-gis-packages.sh
214+
# https://github.com/ipython-contrib/IPython-notebook-extensions
192215
RUN bash /home/jupyterhub/nbextensions/nbextensions-packages.sh
193216

217+
# replace Python with PyPy!
218+
RUN sed -i 's/python3/pypy/g' /usr/local/bin/jupyter
219+
194220
WORKDIR /home/$NB_USER
195221
VOLUME /home/$NB_USER/hostdir
196222

Dockerfile-packages

Lines changed: 67 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#
88
# $ docker build -t hermantolentino/jupyter-packages:v1 -f Dockerfile-packages .
99
#
10+
1011
FROM ubuntu:wily
1112

1213
@@ -23,6 +24,7 @@ RUN apt-get update && apt-get install -yq --no-install-recommends \
2324
bzip2 unzip \
2425
libsm6 \
2526
sudo locales \
27+
locate \
2628
libxrender1 default-jdk \
2729
&& apt-get clean && \
2830
rm -rf /var/lib/apt/lists/*
@@ -46,7 +48,6 @@ RUN dpkg-reconfigure locales
4648
# password: Password1
4749
# You can create your own account by entering the bash shell and creating your own user account or
4850
# change "jupyterhub" and "Password1" below.
49-
#RUN adduser --gecos "" jupyterhub && \
5051
RUN useradd -m -s $SHELL -N -u $NB_UID $NB_USER && \
5152
echo jupyterhub:Password1 | chpasswd
5253
RUN echo "cacert=/etc/ssl/certs/ca-certificates.crt" > /home/$NB_USER/.curlrc
@@ -79,65 +80,56 @@ RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 0527A9B7 && \
7980
RUN chmod +x /tini
8081

8182
RUN apt-get update
82-
RUN apt-get install -y python-dev python3-dev npm python-pip python3-pip nodejs-legacy
83+
RUN apt-get install -y python-dev python3-dev npm python-pip python3-pip nodejs-legacy virtualenv pypy
84+
RUN apt-get install -y libzmq3 libzmq3-dev python3-zmq
8385

84-
# configure Python virtual environments
86+
# use bash
8587
RUN ln -snf /bin/bash /bin/sh
86-
RUN pip install virtualenv && \
87-
pip3 install virtualenv
88+
89+
# configure Python virtual environments
90+
RUN virtualenv --system-site-packages -p /usr/bin/pypy /vepypy && \
91+
source /vepypy/bin/activate && \
92+
pip install --upgrade setuptools jupyter ipykernel requests pyzmq terminado jupyter_contrib_core && \
93+
ipython kernel install --name vepypy --display-name "Python-PyPy 2.7" && \
94+
deactivate
8895

8996
RUN virtualenv --system-site-packages -p /usr/bin/python2 /venv27 && \
90-
source venv27/bin/activate && \
91-
pip install notebook ipykernel requests terminado && \
92-
ipython kernelspec install-self && \
97+
source /venv27/bin/activate && \
98+
pip install --upgrade setuptools jupyter ipykernel requests terminado jupyter_contrib_core && \
99+
ipython kernel install --name python2 --display-name "Python 2.7" && \
93100
deactivate
94101

95102
RUN virtualenv --system-site-packages -p /usr/bin/python3 /venv35 && \
96-
source venv35/bin/activate && \
97-
pip3 install notebook ipykernel requests terminado && \
98-
ipython3 kernelspec install-self && \
103+
source /venv35/bin/activate && \
104+
pip3 install --upgrade setuptools jupyter ipykernel requests terminado jupyter_contrib_core && \
105+
ipython kernel install --name python3 --display-name "Python 3.5" && \
99106
deactivate
100107

101108
RUN npm install -g configurable-http-proxy && \
102109
pip3 install jupyterhub && \
103-
pip3 install jupyter && \
110+
pip3 install jupyter jupyter_core jupyter_contrib_core && \
104111
mkdir -p /etc/jupyterhub && \
105112
mkdir -p /root/work
106-
107113
COPY etc/jupyterhub_config.py /etc/jupyterhub/
108114
COPY startjupyterhub.sh /root/work
109115
COPY stopjupyterhub.sh /root/work
110116

111117
RUN mkdir -p /var/log/jupyterhub
112118
RUN touch /var/log/jupyterhub/jupyterhub.log
113119

114-
## Install R
115-
RUN mkdir -p /usr/local/lib/R/site-library && \
116-
chmod -R a+w /usr/local/lib/R/site-library
117-
118-
RUN echo 'deb http://cran.rstudio.com/bin/linux/ubuntu trusty/' >> /etc/apt/sources.list && \
119-
echo "options(repos = c(CRAN = 'http://cran.us.r-project.org'))" > /etc/Rprofile.site
120-
121-
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
122-
RUN apt-get update -y && \
123-
apt-get install -y r-base r-base-dev r-base-core
124-
120+
# Install Bash shell
121+
# http://datascienceatthecommandline.com/#tools
122+
RUN pip2 install bash_kernel && \
123+
pip3 install bash_kernel && \
124+
python3 -m bash_kernel.install
125+
RUN pip3 install awscli bigmler csvkit
125126
RUN apt-get update && \
126-
apt-get -y build-dep libcurl4-gnutls-dev && \
127-
apt-get -y install libcurl4-gnutls-dev libzmq3-dev r-cran-rjava r-cran-rodbc curl swig sqlite3
128-
129-
RUN R -e "install.packages('RCurl', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
130-
R -e "install.packages('curl', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
131-
R -e "install.packages('httr', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
132-
R -e "install.packages('devtools', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
133-
R -e "install.packages('repr', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
134-
R -e "install.packages('base64enc', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
135-
R -e "install.packages('evaluate', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
136-
R -e "install.packages('uuid', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
137-
R -e "install.packages(c('rzmq', 'IRkernel','IRdisplay'), repos = 'http://irkernel.github.io/', type = 'source')" && \
138-
R -e "IRkernel::installspec(user=FALSE)"
127+
apt-get install -y cowsay mawk bc feedgnuplot findutils less parallel tree curl && \
128+
echo "export PATH=$PATH:/usr/games" >> /etc/profile && \
129+
echo "export PATH=$PATH:/usr/games" >> /home/jupyterhub/.bashrc
130+
RUN npm install xml2json-command
139131

140-
# Install Scale 2.11
132+
# Install Scala 2.11
141133
# Based on https://github.com/alexarchambault/jupyter-scala
142134
# Initial launch in notebook takes a while due to launcher downloading additional libraries
143135
# util.Properties.versionString
@@ -158,12 +150,41 @@ RUN apt-add-repository ppa:brightbox/ruby-ng --yes && \
158150
RUN apt-get install -y ruby2.2 ruby2.2-dev libtool-bin libmagickwand-dev imagemagick bundler gnuplot \
159151
libgsl0-dev zlib1g-dev libatlas-base-dev
160152
RUN apt-get install -y libblas-dev checkinstall && \
161-
apt-get install -y liblapacke-dev checkinstall
153+
apt-get install -y liblapacke-dev checkinstall autoconf automake
162154
RUN gem install erector bundler gnuplot
163155
RUN gem install sciruby-full
164156
# iruby register creates the kernel.json and kernelspec install makes it visible to jupyter
165157
RUN iruby register --force && \
166-
jupyter kernelspec install /root/.ipython/kernels/ruby
158+
ipython kernelspec install /root/.ipython/kernels/ruby
159+
160+
## Install R
161+
RUN mkdir -p /usr/local/lib/R/site-library && \
162+
chmod -R a+w /usr/local/lib/R/site-library
163+
164+
RUN echo 'deb http://cran.rstudio.com/bin/linux/ubuntu trusty/' >> /etc/apt/sources.list && \
165+
echo "options(repos = c(CRAN = 'http://cran.us.r-project.org'))" > /etc/Rprofile.site
166+
167+
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
168+
RUN apt-get update -y && \
169+
apt-get install -y r-base r-base-dev r-base-core
170+
171+
RUN apt-get update && \
172+
apt-get -y build-dep libcurl4-gnutls-dev && \
173+
apt-get -y install libcurl4-gnutls-dev libzmq3-dev r-cran-rjava r-cran-rodbc swig sqlite3 libssh2-1-dev
174+
175+
RUN R -e "install.packages('RCurl', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
176+
R -e "install.packages('curl', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
177+
R -e "install.packages('httr', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
178+
R -e "install.packages('devtools', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
179+
R -e "install.packages('repr', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
180+
R -e "install.packages('base64enc', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
181+
R -e "install.packages('evaluate', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
182+
R -e "install.packages('uuid', lib='/usr/local/lib/R/site-library', repos='http://cran.rstudio.com/')" && \
183+
R -e "install.packages('rzmq', repos = 'http://irkernel.github.io/', type = 'source')"
184+
RUN R -e "install.packages(c('IRkernel','IRdisplay'), repos = 'http://irkernel.github.io/', type = 'source')" && \
185+
R -e "IRkernel::installspec(user=FALSE)"
186+
187+
RUN apt-get install -y libyaml-dev
167188

168189
# Backup local files to container image
169190
COPY etc/ /root/work/.backup/
@@ -190,13 +211,18 @@ RUN chmod a+w -R /home/$NB_USER
190211
RUN chmod a+x /home/$NB_USER/*.sh
191212
RUN chmod a+x /home/$NB_USER/packages/*.sh
192213

193-
# Install Python and R packages
214+
# Install Python, R and notebook extension packages
194215
RUN bash /home/jupyterhub/packages/python-packages.sh
195216
RUN bash /home/jupyterhub/packages/python-gis-packages.sh
196217
RUN bash /home/jupyterhub/packages/python-nlp-packages.sh
197218
RUN bash /home/jupyterhub/packages/r-packages.sh
219+
RUN bash /home/jupyterhub/packages/r-gis-packages.sh
220+
# https://github.com/ipython-contrib/IPython-notebook-extensions
198221
RUN bash /home/jupyterhub/nbextensions/nbextensions-packages.sh
199222

223+
# replace Python with PyPy!
224+
RUN sed -i 's/python3/pypy/g' /usr/local/bin/jupyter
225+
200226
WORKDIR /home/$NB_USER
201227
VOLUME /home/$NB_USER/hostdir
202228

0 commit comments

Comments
 (0)