-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
200 lines (179 loc) · 4.69 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
FROM rocker/verse:4.1.2
ARG DEBIAN_FRONTEND=noninteractive
############################
### Install APT packages ###
############################
# gcc through libtool for treePL
# libmagick for animation->magick->phytools
# unar for unzipping files with unicode filenames
# the rest are same dependencies as rocker/geospatial
# https://hub.docker.com/r/rocker/geospatial/dockerfile
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git-lfs \
mafft \
fasttree \
gcc \
g++ \
libnlopt-dev \
libnlopt0 \
libcolpack-dev \
make \
libomp-dev \
build-essential \
autoconf \
autotools-dev \
automake \
libtool \
libmagick++-dev \
unar \
lbzip2 \
libfftw3-dev \
libgeos-dev \
libgdal-dev \
libgsl-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libhdf4-alt-dev \
libhdf5-dev \
libjq-dev \
libpq-dev \
libproj-dev \
libprotobuf-dev \
libnetcdf-dev \
libsqlite3-dev \
libssl-dev \
libudunits2-dev \
netcdf-bin \
postgis \
protobuf-compiler \
sqlite3 \
tk-dev \
unixodbc-dev \
libgdal-dev \
libzmq3-dev \
libgmp3-dev \
libpng-dev
#############################
### Other custom software ###
#############################
ENV APPS_HOME=/apps
RUN mkdir $APPS_HOME
WORKDIR $APPS_HOME
### treePL ###
# patches have been applied since v1.0 but no further version tagged.
# so use the most recent commit hash
ENV VERSION=6e23cdb08c7ec9283ebbee909d783cb0d44e64d5
RUN git clone https://github.com/blackrim/treePL.git \
&& cd $APPS_HOME/treePL \
&& git checkout $VERSION \
&& cd $APPS_HOME/treePL/deps/ \
&& tar xvzf adol-c_git_saved.tar.gz \
&& cd $APPS_HOME/treePL/deps/adol-c/ \
&& ./update_versions.sh \
&& ./configure --with-openmp-flag=-fopenmp --prefix=/usr \
&& make \
&& make install \
&& cd $APPS_HOME/treePL/src \
&& ./configure \
&& make \
&& echo '/usr/lib64' > /etc/ld.so.conf.d/lib64.conf \
&& ldconfig \
&& cp treePL /usr/local/bin
### gnparser ###
WORKDIR $APPS_HOME
ENV APP_NAME=gnparser
ENV VERSION=1.3.3
ENV DEST=$APPS_HOME/$APP_NAME/$VERSION
RUN wget https://github.com/gnames/$APP_NAME/releases/download/v$VERSION/$APP_NAME-v$VERSION-linux.tar.gz \
&& tar xf $APP_NAME-v$VERSION-linux.tar.gz \
&& rm $APP_NAME-v$VERSION-linux.tar.gz \
&& mv "$APP_NAME" /usr/local/bin/
### IQ Tree ###
WORKDIR $APPS_HOME
ENV APP_NAME=iqtree
ENV VERSION=1.6.12
ENV DEST=$APPS_HOME/$APP_NAME/$VERSION
RUN wget https://github.com/Cibiv/IQ-TREE/releases/download/v$VERSION/$APP_NAME-$VERSION-Linux.tar.gz \
&& tar xf $APP_NAME-$VERSION-Linux.tar.gz \
&& rm $APP_NAME-$VERSION-Linux.tar.gz \
&& mv "$APP_NAME-$VERSION-Linux/bin/iqtree" /usr/local/bin/
###########################################
### Install latex package with tiny tex ###
###########################################
# \n\ puts each package name on its own line
RUN printf 'amsmath\n\
atbegshi\n\
atveryend\n\
auxhook\n\
bigintcalc\n\
bitset\n\
booktabs\n\
colortbl\n\
environ\n\
etexcmds\n\
etoolbox\n\
euenc\n\
fancyhdr\n\
fancyvrb\n\
float\n\
fontspec\n\
framed\n\
geometry\n\
gettitlestring\n\
grffile\n\
hycolor\n\
hyperref\n\
iftex\n\
infwarerr\n\
intcalc\n\
kvdefinekeys\n\
kvoptions\n\
kvsetkeys\n\
latex-amsmath-dev\n\
letltxmacro\n\
ltxcmds\n\
makecell\n\
mdwtools\n\
multirow\n\
pdfescape\n\
pdflscape\n\
pdftexcmds\n\
refcount\n\
rerunfilecheck\n\
setspace\n\
siunitx\n\
stringenc\n\
tabu\n\
threeparttable\n\
threeparttablex\n\
tipa\n\
trimspaces\n\
ulem\n\
unicode-math\n\
uniquecounter\n\
varwidth\n\
wrapfig\n\
xcolor\n\
xunicode\n\
zapfding' >> latex_packages.txt \
&& Rscript -e 'tinytex::tlmgr_update(); tinytex::tlmgr_install(readLines("latex_packages.txt"))' \
&& rm latex_packages.txt
####################################
### Install R packages with renv ###
####################################
# Create directory for renv project library
RUN mkdir /renv
# Modify Rprofile.site so renv uses /renv for project library, and doesn't use the cache
RUN echo 'Sys.setenv(RENV_PATHS_LIBRARY = "/renv")' >> /usr/local/lib/R/etc/Rprofile.site
# Initialize a 'dummy' project and restore the renv library.
# Since the library path is specified as above, the library will be restored to /renv
RUN mkdir -p /tmp/project/renv/local
# Copy needed files: renv.lock and a local package
COPY ./renv.lock /tmp/project
# Install packages to the dummy project using renv::restore()
WORKDIR /tmp/project
# Don't use cache (the symlinks won't work from Rstudio server)
RUN Rscript -e 'devtools::install_github("rstudio/[email protected]"); renv::consent(provided = TRUE); renv::settings$use.cache(FALSE); renv::init(bare = TRUE); renv::restore()'
WORKDIR /home/rstudio/
RUN rm -rf /tmp/project