-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile22
226 lines (182 loc) · 10.5 KB
/
Dockerfile22
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
# Coding Dockerfile
#
# https://github.com/tamboraorg/docker/crecoding
#
# Pull base image.
FROM credocker/creubuntu:2022.0
MAINTAINER Michael Kahle <[email protected]>
ARG BUILD_YEAR=2022
ARG BUILD_MONTH=0
ARG BUILD_TAG=latest
# version: yyyy.n for stable versions / 0.yyyy for development
ENV PROCESSOR_MODE CPU # 'GPU' or 'CPU'
ENV NVIDIA_VERSION 470
ENV JULIA_VERSION 1.6.6
ENV RUST_VERSION 1.57.0
ENV LISP_VERSION 2.0.1
ENV R_VERSION 4.1.2
ENV QUARTO_VERSION 1.1.251
LABEL Name="Coding for CRE" \
CRE=$CRE_VERSION \
Year=$BUILD_YEAR \
Month=$BUILD_MONTH \
Version=$PYTHON_VERSION \
OS="Ubuntu:$UBUNTU_VERSION" \
Build_=$BUILD_TAG
# install GPU driver
# https://www.linuxbabe.com/ubuntu/install-nvidia-driver-ubuntu-18-04
RUN add-apt-repository ppa:graphics-drivers/ppa
RUN apt-get -y --no-install-recommends install ubuntu-drivers-common
RUN ubuntu-drivers devices
#RUN ubuntu-drivers autoinstall
RUN apt-get -y --no-install-recommends install nvidia-driver-$NVIDIA_VERSION
#RUN apt-get -y --no-install-recommends install nvidia-$NVIDIA_VERSION
# install OpenBlas
RUN apt-get -y --no-install-recommends install libopenblas-dev liblapack-dev
#cmake pkg-config
# install libspatial
RUN apt-get update && apt-get -y --no-install-recommends install libspatialindex-dev && apt-get clean
# install Python
RUN apt-get update && apt-get -y --no-install-recommends install python3-dev python3-plotly && apt-get clean
##RUN apt-get update && apt-get -y --no-install-recommends install python3 python3-dev python3-setuptools python3-pip python3-plotly && apt-get clean
RUN apt-get -y --no-install-recommends install python3-numpy python3-scipy python3-matplotlib python3-h5py
##RUN pip3 install --upgrade pip
RUN pip3 install setuptools wheel psutil pipreqs arrow
## No module named 'gendoc' -> 22.04 only
## RUN pip3 install --upgrade pip
## RUN pip3 install gendoc
## RUN pip3 install datatable
# plotly==5.9 ??
# https://github.com/cgoldberg/xvfbwrapper
RUN pip3 install matplotlib seaborn plotly kaleido xvfbwrapper
# rtree==0.9.4 & geopandas==0.6 & xlrd==1.2 & openpyxl==3.0 ??
RUN pip3 install numpy scipy rtree pandas geopandas patsy statsmodels xlrd openpyxl
# beautifulsoup4==4.9 ??
RUN pip3 install Flask connexion beautifulsoup4
#RUN pip3 install pycurl #recommended by jupyterlab
# https://pingouin-stats.org/build/html/index.html
RUN pip3 install pingouin
RUN pip3 install selenium
# OpenCV
RUN apt-get -y --no-install-recommends install python3-opencv
RUN pip3 install opencv-python
# install R
# https://packages.ubuntu.com/search?suite=default§ion=all&arch=any&keywords=r-cran-c&searchon=names
RUN apt-get -y --no-install-recommends install liblapack-dev gfortran cmake
RUN apt-get -y --no-install-recommends install r-base r-recommended
RUN apt-get -y --no-install-recommends install r-cran-adegraphics r-cran-amore r-cran-animation r-cran-cli
RUN apt-get -y --no-install-recommends install r-cran-colorspace r-cran-data.table r-cran-date r-cran-devtools r-cran-foreach
RUN apt-get -y --no-install-recommends install r-cran-formatr r-cran-formula r-cran-ggplot2 r-cran-gmaps r-cran-gnm
RUN apt-get -y --no-install-recommends install r-cran-gsl r-cran-highr r-cran-iterators r-cran-jsonlite r-cran-labeling
#removed: https://cran.r-project.org/web/packages/its/index.html
##RUN apt-get -y --no-install-recommends install r-cran-its
RUN apt-get -y --no-install-recommends install r-cran-lambda.r r-cran-mapdata r-cran-mapproj r-cran-maps r-cran-maptools
RUN apt-get -y --no-install-recommends install r-cran-mcmc r-cran-mcmcpack r-cran-mfilter r-cran-ncdf4 r-cran-nlp r-cran-openssl
RUN apt-get -y --no-install-recommends install r-cran-pheatmap r-cran-plotly r-cran-png r-cran-prettyunits r-cran-raster r-cran-rcolorbrewer
RUN apt-get -y --no-install-recommends install r-cran-rcpp r-cran-rcurl r-cran-rjson r-cran-rmpi
RUN apt-get -y --no-install-recommends install r-cran-rpostgresql r-cran-rsqlite r-cran-rstudioapi r-cran-scatterplot3d
RUN apt-get -y --no-install-recommends install r-cran-sp r-cran-spatial r-cran-tibble
RUN apt-get -y --no-install-recommends install r-cran-tidyr r-cran-tm r-cran-utf8 r-cran-uuid r-cran-v8
RUN apt-get -y --no-install-recommends install r-cran-vcd r-cran-vcdextra r-cran-vioplot
RUN apt-get -y --no-install-recommends install r-cran-wikidatar r-cran-wordcloud r-cran-xml r-cran-xml2 r-cran-xtable r-cran-xts
RUN apt-get -y --no-install-recommends install r-cran-shiny r-cran-shinybs r-cran-shinydashboard r-cran-shinyjs
RUN apt-get -y --no-install-recommends install pandoc r-cran-rmarkdown r-cran-markdown r-cran-knitr
# markdown rust-markdown
# Handle csv meta data csv for web
# https://pypi.org/project/csvw/
# https://csvw.org/standards.html
#RUN apt-get -y --no-install-recommends install r-cran-csvwr #not working...
RUN R -e "install.packages('csvwr')"
# Install Quarto
# https://quarto.org
##RUN wget https://github.com/quarto-dev/quarto-cli/releases/download/v$QUARTO_VERSION/quarto-$QUARTO_VERSION-linux-amd64.tar.gz \
## && tar -C /usr/local/bin -xvzf quarto-$QUARTO_VERSION-linux-amd64.tar.gz \
## && mv /usr/local/bin/quarto-$QUARTO_VERSION /usr/local/bin/quarto
## && rm quarto-$QUARTO_VERSION-linux-amd64.tar.gz
RUN wget https://github.com/quarto-dev/quarto-cli/releases/download/v$QUARTO_VERSION/quarto-$QUARTO_VERSION-linux-amd64.deb \
&& dpkg -i quarto-$QUARTO_VERSION-linux-amd64.deb \
&& rm quarto-$QUARTO_VERSION-linux-amd64.deb
## not (yet?) available , 20.04 only
## https://www.rplumber.io/
## https://www.r-bloggers.com/how-to-create-an-api-for-your-r-code/
#RUN apt-get -y --no-install-recommends install r-cran-plumber
## r-cran-circlize r-cran-clisymbols r-cran-commonmark r-cran-ggsci r-cran-ggthemes r-cran-jpeg r-cran-pdftools r-cran-remotes r-cran-rgdal
## r-cran-rmarkdown r-cran-rstantools r-cran-reticulate r-cran-spacetime r-cran-spatialreg r-cran-svglite r-cran-threejs
## r-cran-tidyverse r-cran-tidygraph r-cran-tidyselect r-cran-tinytex r-cran-tufte r-cran-waveslim r-cran-wavethresh r-cran-webshot r-cran-webutils
## r-cran-shinycssloaders r-cran-shinythemes
## r-cran-mlr r-cran-mlmetrics r-cran-mlbench
# "dplyr", "tidytext", "stopwords"
## rdwd (https://cran.r-project.org/web/packages/rdwd/index.html)
## install.packages("climate") ; climate ; (https://cran.r-project.org/web/packages/climate/index.html)
# (apt install libcurl4-openssl-dev?) && install.packages(c("devtools", "roxygen2", "testthat", "usethis", "knitr"))
# https://rpy2.github.io
RUN pip3 install rpy2
# install rust
RUN apt-get -y --no-install-recommends install rustc cargo
## RUN rustup update # fail
# install cLisp ;-)
# https://packages.ubuntu.com/search?suite=default§ion=all&arch=any&keywords=lisp&searchon=names
RUN apt-get -y --no-install-recommends install clisp
#sbcl
RUN apt-get -y --no-install-recommends install sbcl
# http://www.peter-herth.de/ltk/ltkdoc.pdf
# http://www.peter-herth.de/ltk/ltkdoc/node1.html
RUN apt-get -y --no-install-recommends install tcl
#RUN wget https://github.com/herth/ltk/archive/refs/tags/0.992.tar.gz && \
# tar -xvzf 0.992.tar.gz && \
# mv ltk-0.992/ltk /cre/lisp/ltk && \
# rm -r ltk-0.992 && \
# rm 0.992.tar.gz
RUN wget https://github.com/herth/ltk/archive/refs/tags/0.992.tar.gz
# roswell ## lisp https://github.com/roswell/roswell
##RUN apt-get -y --no-install-recommends install libcurl3
#RUN apt-get -y --no-install-recommends install libcurl4
#RUN curl --output roswell.deb -sL `curl -s https://api.github.com/repos/roswell/roswell/releases/latest | jq -r '.assets | .[] | select(.name|test("deb$")) | .browser_download_url'`
#RUN dpkg -i roswell.deb
## Julia: >=20.04 !=22.04 !!
## RUN apt-get -y --no-install-recommends install julia
#Pkg.add("Spark.jl")
#https://stackoverflow.com/questions/51272077/install-julia-packages-via-command-line/51273146
##RUN julia -e 'using Pkg; Pkg.add("Spark.jl")' ##ERROR
## Pkg.add(“IJulia”)
RUN wget https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.1-linux-x86_64.tar.gz && \
tar -xvzf julia-1.8.1-linux-x86_64.tar.gz && \
cp -r julia-1.8.1 /opt/ && \
ln -s /opt/julia-1.8.1/bin/julia /usr/local/bin/julia && \
rm julia-1.8.1-linux-x86_64.tar.gz
# https://medium.com/@andreaskuhn92/how-to-solve-the-same-numerical-problem-in-7-different-programming-languages-a64daac3ed64
# Freeze python requirements here:
RUN mkdir -p /cre && \
pip3 freeze --no-cache-dir > /cre/requirements.txt.orig
RUN mkdir -p /cre && touch /cre/versions.txt && \
echo "$(date +'%F %R') \t creCoding \t $CRE_VERSION" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t numpy \t $(python3 -c 'import numpy; print(numpy.__version__)')" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t scipy \t $(python3 -c 'import scipy; print(scipy.__version__)')" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t pandas \t $(python3 -c 'import pandas; print(pandas.__version__)')" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t geopandas \t $(python3 -c 'import geopandas; print(geopandas.__version__)')" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t openCV \t $(python3 -c 'import cv2; print(cv2.__version__)')" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t rpy2 \t $(python3 -c 'import rpy2; print(rpy2.__version__)')" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t $(R --version | grep 'R version')" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t sbcl \t $(sbcl --version)" >> /cre/versions.txt && \
# echo "$(date +'%F %R') \t $(ros --version 2>&1)" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t $(julia --version)" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t $(rustc --version)" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t $(cargo --version)" >> /cre/versions.txt && \
# echo "$(date +'%F %R') \t $(/usr/local/bin/quarto --version) >> /cre/versions.txt && \
# echo "$(date +'%F %R') \t $(/opt/quarto/bin/quarto --version) >> /cre/versions.txt && \
# echo "$(date +'%F %R') \t $(quarto --version) >> /cre/versions.txt && \
echo "$(date +'%F %R') \t $(latex --version | grep Debian)" >> /cre/versions.txt
COPY cre /cre
# move full latex to creMedia
# https://yihui.org/tinytex/faq/
# https://yihui.org/tinytex/
RUN wget -qO- "https://yihui.org/tinytex/install-unx.sh" | sh -s - --admin --no-path
RUN ~/.TinyTeX/bin/*/tlmgr path add
# chown -R root:staff ~/.TinyTeX
# chmod -R g+w ~/.TinyTeX
# chmod -R g+wx ~/.TinyTeX/bin
WORKDIR /cre/code ## ??
#WORKDIR /cre
#EXPOSE 8000
ENTRYPOINT ["/cre/coding-entrypoint.sh"]
CMD ["shoreman", "/cre/coding-procfile"]