-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.alpine
312 lines (292 loc) · 11.1 KB
/
Dockerfile.alpine
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
#########################################################################################
#
# E X P E R I M E N T A L: do not use in production.
#
# Docker container based on Alpine Linux. It contained standard GATB-Tool binaries
# originally made using gcc/g++ compiler on a Debian 7 system.
#
# PROS: no need to recompile GATB-Tools
# Big CONS: binaries generate libc++ version warnings...
#
# Solution:
# 1. use Dockerfile.alpine-compiler to generate native GATB-Tool binaries
# for Alpine Linux
# 2. use Dockerfile.alpine2 to wrap these binaires into a single compact Alpine
# container. Here, GATB-Tools work like a charm without any libc++ warnings.
#
#########################################################################################
#
# Docker file for GATB-Tools project.
#
# It prepares a Docker container to run various GATB-Tools jobs:
#
# Simka : https://github.com/GATB/simka <== Visualization not working (see below)
# DSK : https://github.com/GATB/dsk
# BLOOCOO : https://github.com/GATB/bloocoo
# MindTheGap : https://github.com/GATB/MindTheGap <== NOT working in Alpine Container (see below)
# MINIA : https://github.com/GATB/minia
# SHORT READ CONNECTOR: https://github.com/GATB/short_read_connector
# DISCOSNP : https://github.com/GATB/DiscoSnp
# TAKEABREAK : https://github.com/GATB/TakeABreak
#
#########################################################################################
#
# == Docker build command:
#
# docker build -f Dockerfile.alpine -t gatb_tools_machine .
#
# == Docker test command:
#
# docker run --rm -i -t gatb_tools_machine -c test
#
# -> you should see all GATB-Tools tests with some provided data.
#
# docker run --rm -i -t gatb_tools_machine -c version
#
# -> you should see version of all GATB-Tools contained here.
#
# == Running a Tool job:
#
# docker run --rm -i -t gatb_tools_machine -c <command> -- <arguments>
#
# where:
# <command>: see ./run-tool.sh
# <arguments>: see ./run-tool.sh
#
# == Sample Simka job with provided data:
#
# To illustrate the use of this GATB-Tools Docker Image, let's take the example of
# running SIMKA tool.
#
# docker run --rm -i -t -v $PWD:/tmp gatb_tools_machine -c simka -- -in /opt/simka/example/simka_input.txt -out /tmp/simka_results/ -out-tmp /tmp/simka_temp_output
#
# -> you should have results in $PWD/simka_results directory when Simka job is done.
#
# == Additional notes
#
# Root access inside the container:
#
# - if running: docker exec -it gatb_tools_machine bash
#
# - if not yet running: docker run --rm -i -t gatb_tools_machine bash
#
#########################################################################################
FROM alpine:3.6
# (image size after: 4Mb)
# who to blame?
MAINTAINER Patrick Durand [email protected]
# ###
# Package installation and configuration
#
# 1. We need zlib, glibc and libc++ to execute GATB-Tools
# 2. GATB-Tools dependencies are as follows:
# a. Simka : python-2.7 and R
# b. Bloocoo : none
# c. DSK : coreutil (DSK test script uses the paste command)
# d. MindTheGap: util-linux (MindTheGap test script requires the command
# 'column' which is included in bsdmainutils Debian package)
# e. Minia : none
# f. RConnector: none
# g. DiscoSnp : python-2.7
# h. TakeABreak: none
# i. all : bash (test scripts)
# 3. we need curl to reuse "as is" GATB-Tools Docker install commands
# from Debian Dockerfile
# 4. we create the /opt directory
#
# from: https://github.com/sgerrand/alpine-pkg-glibc
RUN apk add --no-cache --update-cache wget ca-certificates && \
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk && \
apk add glibc-2.25-r0.apk && \
apk add --no-cache curl bash util-linux coreutils zlib-dev libstdc++ && \
mkdir -p /opt
# (image size after: 28Mb)
# from: https://github.com/sgerrand/alpine-pkg-R
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://github.com/sgerrand/alpine-pkg-R/releases/download/3.3.1-r0/sgerrand.rsa.pub && \
wget https://github.com/sgerrand/alpine-pkg-R/releases/download/3.3.1-r0/R-3.3.1-r0.apk && \
apk add R-3.3.1-r0.apk
# (image size after: 133Mb)
RUN apk add --no-cache python2
# (image size after: 169Mb)
# added to fix this issue (e.g. when running simka):
# ../bin/simka: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
ENV LD_LIBRARY_PATH=/lib:/lib64:/usr/lib
# ###
# SIMKA installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
ENV SIMKA_VERSION=1.4.0
RUN cd /opt \
&& export SIMKA_TGZ=simka-v${SIMKA_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/simka/releases/download \
&& export SIMKA_URL=${GIT_URL}/v${SIMKA_VERSION}/${SIMKA_TGZ} \
&& curl -ksL ${SIMKA_URL} | tar xz \
&& rm -f ${SIMKA_TGZ} \
&& mv simka-v${SIMKA_VERSION}-bin-Linux simka \
&& cd simka/bin \
&& chmod +x simka* \
&& cd ../example \
&& chmod +x *.sh \
&& ./simple_test.sh
# (image size after: 202Mb)
# Simka Visualization: not available: required X11 !!!
# ###
# DSK installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
ENV DSK_VERSION=2.2.0
RUN cd /opt \
&& export DSK_TGZ=dsk-v${DSK_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/dsk/releases/download \
&& export DSK_URL=${GIT_URL}/v${DSK_VERSION}/${DSK_TGZ} \
&& curl -ksL ${DSK_URL} | tar xz \
&& rm -f ${DSK_TGZ} \
&& mv dsk-v${DSK_VERSION}-bin-Linux dsk \
&& cd dsk/bin \
&& chmod +x * \
&& cd ../test \
&& chmod +x *.sh \
&& ./simple_test.sh
# (image size after: 220Mb)
# ###
# BLOOCOO installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
ENV BLOOCOO_VERSION=1.0.7
RUN cd /opt \
&& export BLOOCOO_TGZ=Bloocoo-v${BLOOCOO_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/bloocoo/releases/download \
&& export BLOOCOO_URL=${GIT_URL}/v${BLOOCOO_VERSION}/${BLOOCOO_TGZ} \
&& curl -ksL ${BLOOCOO_URL} | tar xz \
&& rm -f ${BLOOCOO_TGZ} \
&& mv Bloocoo-v${BLOOCOO_VERSION}-bin-Linux bloocoo \
&& cd bloocoo/bin \
&& chmod +x * \
&& cd ../test \
&& chmod +x *.sh \
&& ./simple_test.sh
# (image size after: 247Mb)
# ###
# MINDTHEGAP installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
ENV MIND_VERSION=2.0.2
RUN cd /opt \
&& export MIND_TGZ=MindTheGap-v${MIND_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/MindTheGap/releases/download \
&& export MIND_URL=${GIT_URL}/v${MIND_VERSION}/${MIND_TGZ} \
&& curl -ksL ${MIND_URL} | tar xz \
&& rm -f ${MIND_TGZ} \
&& mv MindTheGap-v${MIND_VERSION}-bin-Linux MindTheGap \
&& cd MindTheGap/bin \
&& chmod +x * \
&& cd ../test \
&& chmod +x *.sh \
&& ./simple_test.sh
# ###
# GATB-Core installation: get the binary release from Github mirror.
# Note: we only keep HDF5 utility tools: dbgh5, dbginfo, h5dump
#
# We always use the latest official binary release available.
ENV GCORE_VERSION=1.3.0
RUN cd /opt \
&& export GCORE_TGZ=gatb-core-${GCORE_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/gatb-core/releases/download \
&& export GCORE_URL=${GIT_URL}/v${GCORE_VERSION}/${GCORE_TGZ} \
&& curl -ksL ${GCORE_URL} | tar xz \
&& rm -f ${GCORE_TGZ} \
&& mv gatb-core-${GCORE_VERSION}-bin-Linux gatb-core \
&& cd gatb-core \
&& rm -rf examples include lib test/gatb-core-cppunit \
&& cd bin \
&& chmod +x * \
&& mv gatb-h5dump h5dump
COPY test-gcore.sh /opt/gatb-core
RUN cd /opt/gatb-core && ./test-gcore.sh && rm -f /opt/gatb-core/bin/reads3.fa.h5
# (image size after: 286Mb)
# ###
# MINIA installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
ENV MINIA_VERSION=2.0.7
RUN cd /opt \
&& export MINIA_TGZ=minia-v${MINIA_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/minia/releases/download \
&& export MINIA_URL=${GIT_URL}/v${MINIA_VERSION}/${MINIA_TGZ} \
&& curl -ksL ${MINIA_URL} | tar xz \
&& rm -f ${MINIA_TGZ} \
&& mv minia-v${MINIA_VERSION}-bin-Linux minia \
&& cd minia/bin \
&& chmod +x *
# (image size after: 302Mb)
# ###
# SHORT-READ-CONNECTOR installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
ENV SRC_VERSION=1.1.0
RUN cd /opt \
&& export SRC_TGZ=rconnector-v${SRC_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/short_read_connector/releases/download \
&& export SRC_URL=${GIT_URL}/v${SRC_VERSION}/${SRC_TGZ} \
&& curl -ksL ${SRC_URL} | tar xz \
&& rm -f ${SRC_TGZ} \
&& mv rconnector-v${SRC_VERSION}-bin-Linux rconnector \
&& cd rconnector \
&& chmod +x *.sh \
&& cd bin \
&& chmod +x * \
&& cd ../test \
&& chmod +x *.sh \
&& ./simple_test.sh
# (image size after: 302Mb)
# ###
# DISCO-SNP installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
ENV DSNP_VERSION=2.2.10
RUN cd /opt \
&& export DSNP_TGZ=DiscoSNP.-v${DSNP_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/DiscoSnp/releases/download \
&& export DSNP_URL=${GIT_URL}/v${DSNP_VERSION}/${DSNP_TGZ} \
&& curl -ksL ${DSNP_URL} | tar xz \
&& rm -f ${DSNP_TGZ} \
&& mv DiscoSNP++-v${DSNP_VERSION}-bin-Linux discosnp \
&& cd discosnp \
&& chmod +x *.sh \
&& cd bin \
&& chmod +x * \
&& cd ../scripts \
&& chmod +x *.sh \
&& cd ../test \
&& chmod +x *.sh \
&& ./simple_test.sh
# (image size after: 402Mb)
# ###
# TAKE-A-BREAK installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
ENV TABK_VERSION=1.1.2
RUN cd /opt \
&& export TABK_TGZ=TakeABreak-v${TABK_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/TakeABreak/releases/download \
&& export TABK_URL=${GIT_URL}/v${TABK_VERSION}/${TABK_TGZ} \
&& curl -ksL ${TABK_URL} | tar xz \
&& rm -f ${TABK_TGZ} \
&& mv TakeABreak-v${TABK_VERSION}-bin-Linux TakeABreak \
&& cd TakeABreak/bin \
&& chmod +x * \
&& cd ../tests \
&& chmod +x *.sh \
&& ./simple_test.sh
# (image size after: 475Mb)
# ###
# Starter script.
#
COPY run-tool.sh /opt
# Fix: ensure script has exec permission
RUN chmod +x /opt/run-tool.sh
# ###
# Start a GATB-Tool. See "run-tool.sh" header for more information.
#
ENTRYPOINT ["/opt/run-tool.sh"]