-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
397 lines (323 loc) · 12.4 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
#Development (may not be stable)
#version
FROM carlosantagiustina/cocalc AS cleanCocalc
MAINTAINER Carlo R. M. A. Santagiustina ([email protected])
ENV DEBIAN_FRONTEND noninteractive
#ENV VERSION 0.1
# Remove microsoft proprietary tools with telemetry
#RUN rm /etc/apt/sources.list.d/vscode.list;
#RUN rm /etc/apt/trusted.gpg.d/microsoft.gpg /microsoft.gpg
RUN apt-get update && apt-get install -y gnupg gnupg1 gnupg2
# Install additional software
RUN apt-get update --fix-missing
#Install ubuntu libraries
RUN \
apt-get install -y --no-install-recommends \
emacs \
gimp \
scilab \
geogebra \
sqlitebrowser \
nano \
apt-transport-https \
software-properties-common \
sbcl \
libtool \
libffi-dev \
make \
libzmq3-dev \
libczmq-dev \
wget \
software-properties-common \
python3-venv \
pandoc-citeproc
# ruby \
# ruby-dev \
RUN octave --eval 'pkg install -forge dataframe'
################################
######### Chrome #########
################################
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list
RUN apt-get update
RUN apt-get install -y google-chrome-stable
################################
######### Python #########
################################
#install python3 minimal IDE
#text mining tools
RUN \
python3 -m pip install tensorflow
RUN \
python3 -m pip install keras
RUN \
python3 -m pip install spacy
RUN \
python3 -m spacy download it_core_news_sm
RUN \
python3 -m spacy download de_core_news_sm
RUN \
python3 -m spacy download nl_core_news_sm
RUN \
python3 -m spacy download es_core_news_sm
###############################
### SoS : Script of Scripts ###
###############################
RUN \
python3 -m pip install sos
RUN \
python3 -m pip install sos-pbs
RUN \
python3 -m pip install sos-notebook
RUN \
python3 -m sos_notebook.install
#SoS languages
RUN \
python3 -m pip install sos-r
RUN \
python3 -m pip install sos-python
RUN \
python3 -m pip install sos-julia feather-format
RUN \
python3 -m pip install sos-matlab
RUN \
python3 -m pip install sos-ruby
RUN \
python3 -m pip install sos-xeus-cling
#
RUN \
python3 -m pip install sos-essentials
RUN \
python3 -m pip install markdown-kernel
RUN \
python3 -m markdown_kernel.install
RUN \
python3 -m pip install bash_kernel
RUN \
python3 -m bash_kernel.install
################
### Ruby ##
################
RUN apt-get update && apt-get install -yq libtool pkg-config autoconf zlib1g-dev libssl-dev && \
apt-get clean && cd ~ && \
git clone --depth=1 https://github.com/zeromq/libzmq && \
git clone --depth=1 https://github.com/zeromq/czmq && \
cd libzmq && ./autogen.sh && ./configure && make && make install && \
cd ../czmq && ./autogen.sh && ./configure && make && make install && \
cd .. && rm -rf ./libzmq ./czmq && \
wget https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.gz && tar xf ruby-2.4.1.tar.gz && cd ruby-2.4.1 && \
./configure && make && make install && \
rm -rf ./ruby-2.4* && \
gem install cztop iruby rbplotly daru daru_plotly && \
rm -rf /var/lib/apt/lists/* && ldconfig
# iruby register --force
######################################################################################################################
####################################
########### Anaconda ###########
####################################
#Install Anaconda from container continuumio/anaconda3 https://hub.docker.com/r/continuumio/anaconda3/dockerfile
#FROM continuumio/anaconda3 AS anaconda
# RUN apt-get update --fix-missing && apt-get install -y wget bzip2 ca-certificates \
# libglib2.0-0 libxext6 libsm6 libxrender1 \
# git mercurial subversion
# RUN wget --quiet https://repo.anaconda.com/archive/Anaconda3-5.3.0-Linux-x86_64.sh -O ~/anaconda.sh && \
# /bin/bash ~/anaconda.sh -b -p /opt/conda && \
# rm ~/anaconda.sh && \
# ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
# echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
# echo "conda activate base" >> ~/.bashrc
# RUN apt-get install -y curl grep sed dpkg && \
# TINI_VERSION=`curl https://github.com/krallin/tini/releases/latest | grep -o "/v.*\"" | sed 's:^..\(.*\).$:\1:'` && \
# curl -L "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini_${TINI_VERSION}.deb" > tini.deb && \
# dpkg -i tini.deb && \
# rm tini.deb
# RUN export PATH=/opt/conda/bin:$PATH
#Install Miniconda manually
#echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
#RUN \
# wget --quiet https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O ~/anaconda.sh && \
# /bin/bash ~/anaconda.sh -b -p /opt/conda && \
# rm ~/anaconda.sh
# RUN export PATH=/opt/conda/bin:$PATH
#Add Conda kernel to Jupyter
# RUN python -m ipykernel install --prefix=/usr/local/ --name "python3"
######################################################################################################################
####################################
########### R ###########
####################################
ARG R_VERSION
ARG BUILD_DATE
ENV R_VERSION=${R_VERSION:-3.6.1} \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
TERM=xterm
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bash-completion \
ca-certificates \
file \
fonts-texgyre \
g++ \
gfortran \
gsfonts \
libblas-dev \
libbz2-1.0 \
libcurl4\
curl
# libx11-dev
ENV R_BASE_VERSION 3.6.1
## Now install R and littler, and create a link for littler in /usr/local/bin
## Also set a default CRAN repo, and make sure littler knows about it too
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
littler \
r-cran-littler \
r-base=${R_BASE_VERSION}* \
r-base-dev=${R_BASE_VERSION}* \
r-recommended=${R_BASE_VERSION}*
#update R packages and remove old library
RUN rm -r /usr/local/lib/R/site-library
RUN \
R -e '.libPaths("/usr/lib/R/library")'
RUN \
R -e 'install.packages(c("rlang","rversions","roxygen2","devtools","digest","glue"),lib="/usr/lib/R/library")'
RUN \
R -e 'install.packages(c("Rcpp","htmltools"),lib="/usr/lib/R/library")'
RUN apt-get install -y --no-install-recommends \
libxml2-dev libpoppler-cpp-dev libgdal-dev libproj-dev gdal-bin libudunits2-dev
RUN \
R -e 'update.packages(lib.loc = "/usr/lib/R/library", ask = FALSE, checkBuilt = TRUE)'
RUN \
R -e 'install.packages(c("units","ps","processx","fs","usethis","sf","cartography"),lib="/usr/lib/R/library")'
RUN \
R -e 'install.packages(c("devtools","rticles","JuliaCall","rmdformats","bookdown","readtext","webshot","pageviews","knitr","DT","feather","tidyverse","swagger","reticulate","pillar","biomaRt","formatR", "rmarkdown","shiny","plumber","ckanr"),lib="/usr/lib/R/library")'
RUN \
R -e 'devtools::install_github("IRkernel/IRkernel",lib="/usr/lib/R/library")'
RUN \
R -e 'install.packages(c("rJava"),lib="/usr/lib/R/library")'
RUN \
R -e 'webshot::install_phantomjs()'
#TEXT MINING, NLP AND MODELLING
RUN \
R -e 'install.packages(c("text2vec","tidytext","udpipe","syuzhet","stm","lda","openNLP", "quanteda","spacyr", "tm","NLP","RWeka","koRpus"),lib="/usr/lib/R/library")'
#RUN \
#R -e 'install.packages("openNLPmodels.en",
# repos = "http://datacube.wu.ac.at/",
# type = "source",lib="/usr/lib/R/library")'
#RUN \
#R -e 'install.packages("openNLPmodels.it",
# repos = "http://datacube.wu.ac.at/",
# type = "source",lib="/usr/lib/R/library")'
#RUN \
#R -e 'install.packages("openNLPmodels.de",
# repos = "http://datacube.wu.ac.at/",
# type = "source",lib="/usr/lib/R/library")'
#RUN \
#R -e 'install.packages("StanfordCoreNLP",
# repos = "http://datacube.wu.ac.at/",
# type = "source",lib="/usr/lib/R/library")'
#RUN \
#R -e 'install.packages("tm.lexicon.GeneralInquirer",
# repos = "http://datacube.wu.ac.at/",
# type = "source",lib="/usr/lib/R/library")'
#RUN \
#R -e 'install.packages("riwordnet",
# repos = "http://datacube.wu.ac.at/",
# type = "source",lib="/usr/lib/R/library")'
#VISUALIZATION
RUN \
R -e 'install.packages(c("igraph","listviewer","cesium","plotly","r2d3","ggplot2","leaflet","visNetwork","igraph"),lib="/usr/lib/R/library")'
#API REQUESTS AND WEB SCRAPING
RUN \
R -e 'install.packages(c("curl","RCurl","rjson","rvest","httr","jsonlite","rtweet","plotly","r2d3","udpipe","ggplot2","leaflet","visNetwork","swagger"),lib="/usr/lib/R/library")'
#for SoS tutorials
# R -e 'devtools::install_github("grimbough/biomaRt")'
######################################################################################################################
####################################
########### RStudio ###########
####################################
#install gdebi-core (for deb command)
RUN \
apt install -y --no-install-recommends gdebi-core
#update Rstudio
#RUN \
# cd /projects/tmp
#RUN \
# wget https://download1.rstudio.org/desktop/bionic/amd64/rstudio-1.2.1335-amd64.deb
#RUN \
# mv rstudio-1.2.1335-amd64.deb rstudio.deb
#RUN \
# dpkg -i rstudio.deb
#RUN \
# apt --fix-broken install
######################################################################################################################
##################################
########### Tensor flow #########
##################################
#install reticulate, tensorflow and keras
# RUN \
# R -e 'install.packages(c("reticulate"),lib="/usr/lib/R/library")'
#RUN \
# R -e 'reticulate::virtualenv_create("py3-virtualenv", python = "/usr/bin/python3")'
#RUN \
# R -e 'reticulate::use_virtualenv("py3-virtualenv")'
#RUN \
# R -e 'devtools::install_github("rstudio/tensorflow")'
#RUN \
# R -e 'tensorflow::install_tensorflow(method ="virtualenv", envname = "py3-virtualenv")'
#RUN \
# R -e 'devtools::install_github("rstudio/keras")'
#RUN \
# R -e 'keras::install_keras(method ="virtualenv", envname = "py3-virtualenv")'
################
### Julia ##
################
# install Julia packages in /opt/julia instead of $HOME
ENV JULIA_DEPOT_PATH=/opt/julia
ENV JULIA_PKGDIR=/opt/julia
ENV JULIA_VERSION=1.2.0
RUN mkdir /opt/julia-${JULIA_VERSION} && \
cd /tmp && \
wget -q https://julialang-s3.julialang.org/bin/linux/x64/`echo ${JULIA_VERSION} | cut -d. -f 1,2`/julia-${JULIA_VERSION}-linux-x86_64.tar.gz && \
echo "926ced5dec5d726ed0d2919e849ff084a320882fb67ab048385849f9483afc47 *julia-${JULIA_VERSION}-linux-x86_64.tar.gz" | sha256sum -c - && \
tar xzf julia-${JULIA_VERSION}-linux-x86_64.tar.gz -C /opt/julia-${JULIA_VERSION} --strip-components=1 && \
rm /tmp/julia-${JULIA_VERSION}-linux-x86_64.tar.gz
RUN ln -fs /opt/julia-*/bin/julia /usr/local/bin/julia
RUN julia -e 'import Pkg; Pkg.update()' && \
(test $TEST_ONLY_BUILD || julia -e 'import Pkg; Pkg.add("HDF5")') && \
julia -e "using Pkg; pkg\"add IJulia\"; pkg\"precompile\""
#julia
#using Pkg
#using Pkg
#Pkg.add("Feather")
#Pkg.add("DataFrames")
#Pkg.add("NamedArrays")
#ENV["JUPYTER"] = "/usr/bin/jupyter"
#Pkg.add("IJulia")
######################################################################################################################
########################
#Kernels' permissions ##
#######################
RUN cd /usr/share/jupyter/ && \
chmod o+rx -R kernels/ && \
chmod u+rx -R kernels/ && \
chmod g+rxw -R kernels/
RUN cd /usr/local/share/jupyter/ && \
chmod o+rxw -R kernels/ && \
chmod u+rxw -R kernels/ && \
chmod g+rxw -R kernels/
#############################################
###permissions all libs (read and execute)###
#############################################
RUN cd /usr/local/ && \
chmod g+rwx -R lib/ && \
chmod o+rx -R lib/ && \
chmod u+rx -R lib/
####################################
######### finalization ###########
####################################
ENV DEBIAN_FRONTEND=newt
#Re-start CoCalc
CMD /root/run.py