@@ -18,6 +18,7 @@ RUN apt-get update && apt-get install -yq --no-install-recommends \
18
18
bzip2 unzip \
19
19
libsm6 \
20
20
sudo locales \
21
+ locate \
21
22
libxrender1 default-jdk \
22
23
&& apt-get clean && \
23
24
rm -rf /var/lib/apt/lists/*
@@ -41,7 +42,6 @@ RUN dpkg-reconfigure locales
41
42
# password: Password1
42
43
# You can create your own account by entering the bash shell and creating your own user account or
43
44
# change "jupyterhub" and "Password1" below.
44
- # RUN adduser --gecos "" jupyterhub && \
45
45
RUN useradd -m -s $SHELL -N -u $NB_UID $NB_USER && \
46
46
echo jupyterhub:Password1 | chpasswd
47
47
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 && \
74
74
RUN chmod +x /tini
75
75
76
76
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
78
79
79
- # configure Python virtual environments
80
+ # use bash
80
81
RUN ln -snf /bin/bash /bin/sh
81
- RUN pip install virtualenv && \
82
- pip3 install virtualenv
83
82
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" && \
88
94
deactivate
89
95
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" && \
94
100
deactivate
95
101
96
102
RUN npm install -g configurable-http-proxy && \
97
103
pip3 install jupyterhub && \
98
- pip3 install jupyter && \
104
+ pip3 install jupyter jupyter_core jupyter_contrib_core && \
99
105
mkdir -p /etc/jupyterhub && \
100
106
mkdir -p /root/work
101
107
COPY etc/jupyterhub_config.py /etc/jupyterhub/
@@ -105,33 +111,19 @@ COPY stopjupyterhub.sh /root/work
105
111
RUN mkdir -p /var/log/jupyterhub
106
112
RUN touch /var/log/jupyterhub/jupyterhub.log
107
113
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
119
120
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
133
125
134
- # Install Scale 2.11
126
+ # Install Scala 2.11
135
127
# Based on https://github.com/alexarchambault/jupyter-scala
136
128
# Initial launch in notebook takes a while due to launcher downloading additional libraries
137
129
# util.Properties.versionString
@@ -152,12 +144,41 @@ RUN apt-add-repository ppa:brightbox/ruby-ng --yes && \
152
144
RUN apt-get install -y ruby2.2 ruby2.2-dev libtool-bin libmagickwand-dev imagemagick bundler gnuplot \
153
145
libgsl0-dev zlib1g-dev libatlas-base-dev
154
146
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
156
148
RUN gem install erector bundler gnuplot
157
149
RUN gem install sciruby-full
158
150
# iruby register creates the kernel.json and kernelspec install makes it visible to jupyter
159
151
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
161
182
162
183
# Backup local files to container image
163
184
COPY etc/ /root/work/.backup/
@@ -184,13 +205,18 @@ RUN chmod a+w -R /home/$NB_USER
184
205
RUN chmod a+x /home/$NB_USER/*.sh
185
206
RUN chmod a+x /home/$NB_USER/packages/*.sh
186
207
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
192
215
RUN bash /home/jupyterhub/nbextensions/nbextensions-packages.sh
193
216
217
+ # replace Python with PyPy!
218
+ RUN sed -i 's/python3/pypy/g' /usr/local/bin/jupyter
219
+
194
220
WORKDIR /home/$NB_USER
195
221
VOLUME /home/$NB_USER/hostdir
196
222
0 commit comments