/
Dockerfile.template
602 lines (574 loc) · 18.4 KB
/
Dockerfile.template
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
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
# :Author: Jonathan Karr <karr@mssm.edu>
# :Date: 2018-08-28
# :Copyright: 2017-2018, Karr Lab
# :License: MIT
# base
FROM ubuntu
# upgrade
RUN apt-get update -y \
&& apt-get upgrade -y \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Create user to run operations in containers
RUN groupadd -r -g 999 container_user \
&& useradd -m -r -u 999 -g container_user container_user
# set time zone
ARG timezone=America/New_York
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends tzdata \
&& rm -rf /var/lib/apt/lists/* \
&& ln -fs /usr/share/zoneinfo/$timezone /etc/localtime \
&& dpkg-reconfigure -f noninteractive tzdata
# set locale
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
locales \
&& rm -rf /var/lib/apt/lists/* \
&& locale-gen en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
# install utilities: Git, SSH
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
git \
ssh \
&& rm -rf /var/lib/apt/lists/*
# install Python
ARG python_version=3.6.5
ARG python_version_major_minor=3.6
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
libbz2-dev \
libexpat1 \
libexpat1-dev \
libffi-dev \
libffi6 \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
tar \
tk-dev \
wget \
zlib1g-dev \
# libdb5.3-dev # Berkeley DB \
# libgdbm-dev # GNU dbm database \
# liblzma-dev # LZMA compression \
# libncursesw-dev # text-based user interfaces \
# libtinfo-dev # terminal information \
# mime-support # MIME support \
\
&& cd /tmp \
&& wget https://www.python.org/ftp/python/${python_version}/Python-${python_version}.tgz -O /tmp/Python-${python_version}.tgz \
&& tar xzf /tmp/Python-${python_version}.tgz \
&& cd /tmp/Python-${python_version} \
&& ./configure \
--prefix=/usr/local \
--enable-optimizations \
--enable-shared \
--enable-unicode=ucs4 \
--with-system-expat \
--with-system-ffi \
&& make \
# && make test \
&& make install \
&& ldconfig \
&& python${python_version_major_minor} -m ensurepip \
&& cd / \
&& rm -r /tmp/Python-${python_version}.tgz \
&& rm -r /tmp/Python-${python_version} \
\
&& apt-get remove -y \
build-essential \
ca-certificates \
libbz2-dev \
libexpat1-dev \
libffi-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
tk-dev \
wget \
zlib1g-dev \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Java
{% if java_install -%}
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
default-jre \
&& rm -rf /var/lib/apt/lists/*
{%- endif %}
# install PostgreSQL client
{% if postgresql_client_install -%}
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
gnupg \
wget \
&& ubuntu_version=`cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d "=" -f 2` \
&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ ${ubuntu_version}-pgdg main" >> /etc/apt/sources.list.d/pgdg_${ubuntu_version}.list \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
postgresql-client-10 \
\
&& apt-get remove -y \
gnupg \
wget \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
{%- endif %}
# install openbabel
{% if openbabel_install -%}
ARG openbabel_version=2.4.1
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
build-essential \
cmake \
libcairo2-dev \
libeigen3-dev \
libxml2-dev \
tar \
wget \
zlib1g-dev \
\
&& cd /tmp \
&& openbabel_version_dash=$(echo $openbabel_version | sed 's/\./-/g') \
&& wget https://github.com/openbabel/openbabel/archive/openbabel-${openbabel_version_dash}.tar.gz -O /tmp/openbabel-${openbabel_version}.tar.gz \
&& tar -xvvf /tmp/openbabel-${openbabel_version}.tar.gz \
&& cd openbabel-openbabel-${openbabel_version_dash} \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make \
# && make test \
&& make install \
&& ldconfig \
&& cd / \
&& rm -r /tmp/openbabel-${openbabel_version}.tar.gz \
&& rm -r /tmp/openbabel-openbabel-${openbabel_version_dash} \
\
&& apt-get remove -y \
build-essential \
cmake \
libcairo2-dev \
libeigen3-dev \
libxml2-dev \
wget \
zlib1g-dev \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
{%- endif %}
# install cplex
{% if cplex_install -%}
ARG cplex_version=12.8.0
ARG cplex_version_major_minor_nodot=128
COPY cplex_studio${cplex_version_major_minor_nodot}.linux-x86-64.bin /tmp/
COPY cplex.installer.properties /tmp/
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
unzip \
\
&& cd /tmp \
&& ./cplex_studio${cplex_version_major_minor_nodot}.linux-x86-64.bin \
-f /tmp/cplex.installer.properties \
\
&& cd /opt/ibm/ILOG/CPLEX_Studio${cplex_version_major_minor_nodot}/cplex/python/3.6/x86-64_linux/ \
&& pip${python_version_major_minor} install . \
\
&& rm /tmp/cplex_studio${cplex_version_major_minor_nodot}.linux-x86-64.bin \
&& rm /tmp/cplex.installer.properties \
\
&& apt-get remove -y \
unzip \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
{%- endif %}
# install gurobi
{% if gurobi_install -%}
ARG gurobi_version=8.0.1
ARG gurobi_license={{ gurobi_license }}
COPY install_gurobi.exp /tmp/
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
expect \
tar \
wget \
\
&& cd /tmp \
&& gurobi_version_major=$(echo $gurobi_version | cut -d "." -f 1,2) \
&& gurobi_version_nodot=$(echo $gurobi_version | sed 's/\.//g') \
&& wget http://packages.gurobi.com/${gurobi_version_major}/gurobi${gurobi_version}_linux64.tar.gz \
&& tar xvfz gurobi${gurobi_version}_linux64.tar.gz \
&& mv gurobi${gurobi_version_nodot} /opt/ \
&& /tmp/install_gurobi.exp "${gurobi_version_nodot}" "${gurobi_license}" \
&& cd /opt/gurobi${gurobi_version_nodot}/linux64 \
&& python${python_version_major_minor} setup.py install \
&& rm /tmp/gurobi${gurobi_version}_linux64.tar.gz \
&& rm /tmp/install_gurobi.exp \
\
&& apt-get remove -y \
expect \
wget \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
ARG gurobi_version_nodot=800
ENV GUROBI_HOME=/opt/gurobi${gurobi_version_nodot}/linux64 \
PATH="${PATH}:${GUROBI_HOME}/bin" \
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
{%- endif %}
# install mosek
{% if mosek_install -%}
ARG mosek_version=8.1.0.58
COPY {{ mosek_license }} /tmp/
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
tar \
wget \
\
&& cd /tmp \
&& mosek_version_major=$(echo $mosek_version | cut -d "." -f 1,1) \
&& wget https://d2i6rjz61faulo.cloudfront.net/stable/${mosek_version}/mosektoolslinux64x86.tar.bz2 \
&& tar -xvvf mosektoolslinux64x86.tar.bz2 \
&& mv /tmp/mosek /opt/ \
&& mkdir ${HOME}/mosek \
&& mv /tmp/{{ mosek_license }} ${HOME}/mosek/ \
&& cd /opt/mosek/8/tools/platform/linux64x86/python/3/ \
&& python${python_version_major_minor} setup.py install \
&& rm /tmp/mosektoolslinux64x86.tar.bz2 \
&& rm ${HOME}/mosek/{{ mosek_license }} \
\
&& apt-get remove -y \
wget \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
ENV PATH="${PATH}:/opt/mosek/${mosek_version_major}/tools/platform/linux64x86/bin" \
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/mosek/${mosek_version_major}/tools/platform/linux64x86/bin"
{%- endif %}
# install xpress
{% if xpress_install -%}
ARG xpress_version=8.5.3
ARG xpress_license_server={{ xpress_license_server }}
COPY {{ xpress_license }} /tmp/
COPY xpress.egg-info /tmp/
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
tar \
wget \
\
&& cd /tmp \
&& wget https://clientarea.xpress.fico.com/downloads/${xpress_version}/xp${xpress_version}_linux_x86_64_setup.tar \
&& mkdir xp${xpress_version}_linux_x86_64_setup \
&& tar -xvvf xp${xpress_version}_linux_x86_64_setup.tar -C xp${xpress_version}_linux_x86_64_setup \
&& cd /tmp/xp${xpress_version}_linux_x86_64_setup \
&& ./install.sh -l floating-client -a /tmp/{{ xpress_license }} -d /opt/xpressmp -k yes -s ${xpress_license_server} \
&& echo "/opt/xpressmp/lib" | tee /usr/local/lib/python${python_version_major_minor}/site-packages/xpress.pth \
&& cp /tmp/xpress.egg-info /usr/local/lib/python${python_version_major_minor}/site-packages/xpress-${xpress_version}.egg-info \
&& cd /tmp \
&& rm /tmp/xp${xpress_version}_linux_x86_64_setup.tar \
&& rm -r /tmp/xp${xpress_version}_linux_x86_64_setup \
&& rm /tmp/{{ xpress_license }} \
&& rm /tmp/xpress.egg-info \
&& rm /opt/xpressmp/bin/{{ xpress_license }} \
\
&& apt-get remove -y \
wget \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
ENV XPRESSDIR=/opt/xpressmp \
PATH=$PATH:$XPRESSDIR/bin \
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib/x86_64-linux-gnu:$XPRESSDIR/lib \
CLASSPATH=$CLASSPATH:$XPRESSDIR/lib/xprs.jar:$XPRESSDIR/lib/xprb.jar:$XPRESSDIR/lib/xprm.jar \
XPRESS=$XPRESSDIR/bin
{%- endif %}
# COIN-OR: CBC (latest version compatible with CyLP)
{% if cbc_install -%}
ARG cbc_version=2.8.5
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
build-essential \
tar \
wget \
\
&& cd /tmp \
&& wget https://www.coin-or.org/download/source/Cbc/Cbc-${cbc_version}.tgz \
&& tar -xvvf Cbc-${cbc_version}.tgz \
&& cd Cbc-${cbc_version} \
&& mkdir build \
&& cd build \
&& mkdir -p /opt/coin-or/cbc \
&& ../configure -C --prefix=/opt/coin-or/cbc --enable-gnu-packages \
&& make \
# && make test \
&& make install \
&& cd ../../ \
&& rm -r Cbc-${cbc_version} \
&& rm Cbc-${cbc_version}.tgz \
\
&& apt-get remove -y \
build-essential \
wget \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
ENV COIN_INSTALL_DIR=/opt/coin-or/cbc \
PATH=${PATH}:/opt/coin-or/cbc/bin \
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/coin-or/cbc/lib
{%- endif %}
# COIN-OR: coinutils
{% if coin_utils_install -%}
ARG coin_utils_version=2.10.14
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
build-essential \
tar \
wget \
\
&& cd /tmp \
&& wget https://www.coin-or.org/download/source/CoinUtils/CoinUtils-${coin_utils_version}.tgz \
&& tar -xvvf CoinUtils-${coin_utils_version}.tgz \
&& cd CoinUtils-${coin_utils_version} \
&& mkdir build \
&& cd build \
&& mkdir -p /opt/coin-or/coinutils \
&& ../configure -C --prefix=/opt/coin-or/coinutils --enable-gnu-packages \
&& make \
# && make test \
&& make install \
&& cd /tmp \
&& rm -r CoinUtils-${coin_utils_version} \
&& rm CoinUtils-${coin_utils_version}.tgz \
\
&& apt-get remove -y \
build-essential \
wget \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
ENV PATH=${PATH}:/opt/coin-or/coinutils/bin \
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/coin-or/coinutils/lib
{%- endif %}
# install qpOASES
{% if qpoases_install -%}
ARG qpoases_version=3.2.1
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
build-essential \
tar \
wget \
\
&& cd /tmp \
&& wget https://www.coin-or.org/download/source/qpOASES/qpOASES-${qpoases_version}.tgz \
&& tar -xvvf qpOASES-${qpoases_version}.tgz \
&& cd qpOASES-${qpoases_version} \
&& make \
# && make test \
&& mkdir -p /opt/coin-or/qpoases/lib \
&& cp bin/libqpOASES.* /opt/coin-or/qpoases/lib \
&& cp -r include/ /opt/coin-or/qpoases \
&& cd interfaces/python \
&& pip${python_version_major_minor} install cython numpy \
&& python${python_version_major_minor} setup.py install \
&& cd /tmp \
&& rm -r qpOASES-${qpoases_version} \
&& rm qpOASES-${qpoases_version}.tgz \
\
&& apt-get remove -y \
build-essential \
wget \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/coin-or/qpoases/lib
{%- endif %}
# MINOS
{% if minos_install -%}
ARG minos_version=5.6
RUN cd /tmp \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
csh \
gfortran \
git \
make \
wget \
unzip \
\
&& pip${python_version_major_minor} install numpy \
&& wget http://stanford.edu/~saunders/tmp/quadLP.zip \
&& unzip quadLP.zip \
\
&& cd /tmp/quadLP/minos56 \
&& sed -i 's/FC = gfortran/FC = gfortran -fPIC/g' Makefile.defs \
&& make clean \
&& make \
&& cd /tmp/quadLP/minos56/test \
&& make minos \
# && ./run minos t1diet \
\
&& cd /tmp/quadLP/qminos56 \
&& sed -i 's/FC = gfortran/FC = gfortran -fPIC/g' Makefile.defs \
&& make clean \
&& make \
&& cd /tmp/quadLP/qminos56/test \
&& make minos \
# && ./run minos t1diet \
\
&& cd /tmp \
&& git clone https://github.com/SBRG/solvemepy.git \
&& cd solvemepy \
&& git checkout 72db1bac4ee8a479283f54eaf1644119967d4ac0 \
&& cp /tmp/quadLP/minos56/lib/libminos.a ./ \
&& cp /tmp/quadLP/qminos56/lib/libquadminos.a ./ \
&& pip${python_version_major_minor} install . \
\
&& cd /tmp \
&& rm -r quadLP \
&& rm quadLP.zip \
&& rm -r solvemepy \
\
&& apt-get remove -y \
csh \
make \
wget \
unzip \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
{%- endif %}
# SoPlex
{% if soplex_install -%}
ARG soplex_version=3.1.1
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
build-essential \
cmake \
tar \
wget \
\
&& cd /tmp \
&& wget http://soplex.zib.de/download/release/soplex-${soplex_version}.tgz \
&& tar -xvvf soplex-${soplex_version}.tgz \
&& cd soplex-${soplex_version} \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make \
# && make test \
&& make install \
&& cd /tmp \
&& rm -r soplex-${soplex_version} \
&& rm soplex-${soplex_version}.tgz \
\
&& apt-get install -y --no-install-recommends \
libgmp-dev \
\
&& pip${python_version_major_minor} install cython \
&& cd /tmp \
&& git clone https://github.com/SBRG/soplex_cython.git \
&& cd soplex_cython \
&& wget http://soplex.zib.de/download/release/soplex-${soplex_version}.tgz \
&& pip${python_version_major_minor} install . \
&& cd /tmp \
&& rm -r soplex_cython \
\
&& apt-get remove -y \
build-essential \
cmake \
libgmp-dev \
wget \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
{%- endif %}
# kallisto
{% if kallisto_install -%}
ARG kallisto_version=0.44.0
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
tar \
wget \
\
&& cd /tmp \
&& wget https://github.com/pachterlab/kallisto/releases/download/v${kallisto_version}/kallisto_linux-v${kallisto_version}.tar.gz \
&& tar -xvvf kallisto_linux-v${kallisto_version}.tar.gz \
&& cp kallisto_linux-v${kallisto_version}/kallisto /usr/local/bin \
&& rm -rf kallisto_linux-v${kallisto_version} \
&& rm -rf kallisto_linux-v${kallisto_version}.tar.gz \
\
&& apt-get remove -y \
wget \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
{%- endif %}
# Docker
{% if docker_install -%}
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
software-properties-common \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
&& add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable" \
\
&& apt-get update -y \
&& apt-get install -y --no-install-recommends docker-ce \
&& rm -rf /var/lib/apt/lists/*
{%- endif %}
# CircleCI local build agent
{% if circleci_install -%}
RUN curl -o /usr/local/bin/circleci https://circle-downloads.s3.amazonaws.com/releases/build_agent_wrapper/circleci \
&& chmod +x /usr/local/bin/circleci
{%- endif %}
# Install Python packages; pbr has to be installed first to workaround error in sphinxcontrib-spelling installation
COPY requirements.txt /tmp/
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
build-essential \
default-libmysqlclient-dev \
enchant \
graphviz \
pandoc \
swig \
\
&& pip${python_version_major_minor} install -U pip setuptools \
&& pip${python_version_major_minor} install -U \
cython \
ipython \
mock \
numpy \
pbr \
pypandoc \
requests \
six \
&& pip${python_version_major_minor} install -U git+https://github.com/jjhelmus/CyLP.git@py3#egg=cylp \
&& pip${python_version_major_minor} install -r /tmp/requirements.txt \
&& rm tmp/requirements.txt \
\
&& apt-get remove -y \
build-essential \
swig \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Install NCBI taxonomy database and ETE3 package
RUN pip${python_version_major_minor} install ete3 \
&& python${python_version_major_minor} -c "import ete3; ete3.NCBITaxa().get_descendant_taxa('Homo');" \
&& rm /taxdump.tar.gz
# Save image tag to file so it is accessible from within containers
ARG image_tag={{ image_tag }}
RUN echo ${image_tag} > /etc/docker-image-tag
# install debugging utilities
# RUN apt-get update -y \
# && apt-get install -y --no-install-recommends \
# nano \
# postgresql \
# snapd \
# && snap install pycharm-community --classic \
# && rm -rf /var/lib/apt/lists/*
# cleanup
# RUN apt-get remove -y \
# build-essential \
# cmake
# final command
WORKDIR /root
CMD bash