-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
224 lines (187 loc) · 6.83 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
ARG BASE_IMAGE=ubuntu:22.04
ARG BAMBI_VERSION="0.18.0"
ARG BIOBAMBAM2_VERSION="2.0.185-release-20221211202123"
ARG BWA_VERSION="0.7.17"
ARG BWA_MEM2_VERSION="2.2.1"
ARG DEFLATE_VERSION="1.20"
ARG HTSLIB_VERSION="1.21"
ARG IO_LIB_VERSION="1.15.0"
ARG LIBMAUS2_VERSION="2.0.813-release-20221210220409"
ARG NPG_SEQ_COMMON_VERSION="51.1"
ARG SAMTOOLS_VERSION="1.21"
ARG TEEPOT_VERSION="1.2.0"
ARG PCAP_CORE_VERSION="5.7.0"
FROM $BASE_IMAGE as build
WORKDIR /tmp
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -q -y --no-install-recommends \
apt-utils \
ca-certificates \
curl \
dirmngr \
gpg \
gpg-agent \
lsb-release \
locales && \
locale-gen en_GB en_GB.UTF-8 && \
localedef -i en_GB -c -f UTF-8 -A /usr/share/locale/locale.alias en_GB.UTF-8
ENV LANG=en_GB.UTF-8 \
LANGUAGE=en_GB \
LC_ALL=en_GB.UTF-8
# Build tools
RUN apt-get update && \
apt-get install -q -y --no-install-recommends \
autoconf \
automake \
build-essential \
cmake \
gcc \
git \
libtool \
make \
perl \
pkg-config \
unattended-upgrades
# OS build dependencies
RUN apt-get install -q -y --no-install-recommends \
cpanminus \
libboost-dev \
libbz2-dev \
libcurl4-gnutls-dev \
liblzma-dev \
libssl-dev \
libxml2-dev \
nettle-dev \
zlib1g-dev
RUN unattended-upgrade -v
ARG DEFLATE_VERSION
RUN curl -sSL -O https://github.com/ebiggers/libdeflate/releases/download/v${DEFLATE_VERSION}/libdeflate-${DEFLATE_VERSION}.tar.gz && \
tar xzf libdeflate-${DEFLATE_VERSION}.tar.gz && \
cd libdeflate-${DEFLATE_VERSION} && \
cmake -DCMAKE_BUILD_TYPE=Release -S . -B ./build && \
cmake --build ./build && \
cd ./build && \
make -j $(nproc) install && \
ldconfig
ARG IO_LIB_VERSION
RUN SLUG=$(echo ${IO_LIB_VERSION} | tr '.' '-') && \
curl -sSL -O https://github.com/jkbonfield/io_lib/releases/download/io_lib-${SLUG}/io_lib-${IO_LIB_VERSION}.tar.gz && \
tar xzf io_lib-${IO_LIB_VERSION}.tar.gz && \
cd io_lib-${IO_LIB_VERSION} && \
./configure --with-libdeflate && \
make -j $(nproc) install && \
ldconfig
ARG TEEPOT_VERSION
RUN curl -sSL -O "https://github.com/wtsi-npg/teepot/releases/download/${TEEPOT_VERSION}/teepot-${TEEPOT_VERSION}.tar.gz" && \
tar xzf teepot-${TEEPOT_VERSION}.tar.gz && \
cd teepot-${TEEPOT_VERSION} && \
./configure && \
make -j $(nproc) install
ARG HTSLIB_VERSION
RUN curl -sSL -O "https://github.com/samtools/htslib/releases/download/${HTSLIB_VERSION}/htslib-${HTSLIB_VERSION}.tar.bz2" && \
tar xfj htslib-${HTSLIB_VERSION}.tar.bz2 && \
cd htslib-${HTSLIB_VERSION} && \
./configure --with-libdeflate --enable-libcurl --enable-s3 && \
make -j $(nproc) install && \
ldconfig
ARG SAMTOOLS_VERSION
RUN curl -sSL -O "https://github.com/samtools/samtools/releases/download/${SAMTOOLS_VERSION}/samtools-${SAMTOOLS_VERSION}.tar.bz2" && \
tar xfj samtools-${SAMTOOLS_VERSION}.tar.bz2 && \
cd samtools-${SAMTOOLS_VERSION} && \
./configure --with-htslib=system --without-curses && \
make -j $(nproc) install
ARG BWA_VERSION
RUN curl -sSL -O "https://github.com/lh3/bwa/archive/refs/tags/v${BWA_VERSION}.tar.gz" && \
tar xzvf ./v${BWA_VERSION}.tar.gz && \
cd ./bwa-${BWA_VERSION} && \
pwd && \
make CC='gcc -fcommon' -j $(nproc) && \
cp ./bwa /usr/local/bin/ && \
chmod +x /usr/local/bin/bwa && \
ln -s /usr/local/bin/bwa /usr/local/bin/bwa0_6
ARG BWA_MEM2_VERSION
RUN curl -sSL -O "https://github.com/bwa-mem2/bwa-mem2/releases/download/v${BWA_MEM2_VERSION}/bwa-mem2-${BWA_MEM2_VERSION}_x64-linux.tar.bz2" && \
tar xfj ./bwa-mem2-${BWA_MEM2_VERSION}_x64-linux.tar.bz2 && \
cd ./bwa-mem2-${BWA_MEM2_VERSION}_x64-linux && \
cp ./bwa-mem2 /usr/local/bin/ && \
cp ./bwa-mem2.avx /usr/local/bin/ && \
cp ./bwa-mem2.avx2 /usr/local/bin/ && \
cp ./bwa-mem2.avx512bw /usr/local/bin/ && \
cp ./bwa-mem2.sse41 /usr/local/bin/ && \
cp ./bwa-mem2.sse42 /usr/local/bin/
ARG BAMBI_VERSION
RUN git clone --single-branch --branch="$BAMBI_VERSION" --depth=1 "https://github.com/wtsi-npg/bambi.git" && \
cd bambi && \
autoreconf -fi && \
./configure && \
make -j $(nproc) install
ARG LIBMAUS2_VERSION
RUN curl -sSL -O "https://gitlab.com/german.tischler/libmaus2/-/archive/${LIBMAUS2_VERSION}/libmaus2-${LIBMAUS2_VERSION}.tar.bz2" && \
tar xfj libmaus2-${LIBMAUS2_VERSION}.tar.bz2 && \
cd libmaus2-${LIBMAUS2_VERSION} && \
./configure --prefix=/usr/local --with-io_lib --with-nettle && \
make -j $(nproc) install && \
ldconfig
ARG BIOBAMBAM2_VERSION
RUN curl -sSL -O "https://gitlab.com/german.tischler/biobambam2/-/archive/${BIOBAMBAM2_VERSION}/biobambam2-${BIOBAMBAM2_VERSION}.tar.bz2" && \
tar xfj biobambam2-${BIOBAMBAM2_VERSION}.tar.bz2 && \
cd biobambam2-${BIOBAMBAM2_VERSION} && \
./configure && \
make -j $(nproc) install
ARG PCAP_CORE_VERSION
RUN git clone --single-branch --branch="$PCAP_CORE_VERSION" --depth=1 "https://github.com/cancerit/PCAP-core.git" && \
cd PCAP-core/c && \
make -j $(nproc) ../bin/bam_stats CC=gcc CFLAGS='-O3 -g -DVERSION=\"${PCAP_CORE_VERSION}\"' && \
cp ../bin/bam_stats /usr/local/bin/ && \
chmod +x /usr/local/bin/bam_stats
ARG NPG_SEQ_COMMON_VERSION
RUN git clone --single-branch --branch="$NPG_SEQ_COMMON_VERSION" --depth=1 "https://github.com/wtsi-npg/npg_seq_common.git" && \
cd npg_seq_common && \
cp ./bin/seqchksum_merge.pl /usr/local/bin/ && \
chmod +x /usr/local/bin/seqchksum_merge.pl
RUN cpanm --notest --local-lib /usr/local Module::Build
COPY . ./p4
RUN cd p4 && \
cpanm --notest --local-lib /usr/local --installdeps . && \
cpanm --notest --local-lib /usr/local .
FROM $BASE_IMAGE
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -q -y --no-install-recommends \
apt-utils \
ca-certificates \
lsb-release \
unattended-upgrades \
locales && \
locale-gen en_GB en_GB.UTF-8 && \
localedef -i en_GB -c -f UTF-8 -A /usr/share/locale/locale.alias en_GB.UTF-8
ENV LANG=en_GB.UTF-8 \
LANGUAGE=en_GB \
LC_ALL=en_GB.UTF-8
RUN apt-get install -q -y --no-install-recommends \
libboost-atomic1.74.0 \
libbz2-1.0 \
libcurl3-gnutls \
libcurl4 \
libgomp1 \
liblzma5 \
libnettle8 \
libssl3 \
libxml2 \
zlib1g \
perl && \
unattended-upgrade -v && \
apt-get remove -q -y unattended-upgrades && \
apt-get autoremove -q -y && \
apt-get clean -q -y && \
rm -rf /var/lib/apt/lists/*
COPY --from=build /usr/local /usr/local
RUN ldconfig
ARG APP_USER=appuser
ARG APP_UID=1000
ARG APP_GID=$APP_UID
WORKDIR /app
RUN groupadd --gid $APP_GID $APP_USER && \
useradd --uid $APP_UID --gid $APP_GID --shell /bin/bash --create-home $APP_USER
USER $APP_USER
ENTRYPOINT []
CMD ["/bin/bash"]