forked from StaPH-B/docker-builds
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
135 lines (116 loc) · 4.45 KB
/
Dockerfile
File metadata and controls
135 lines (116 loc) · 4.45 KB
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
# Set global variables
ARG HOCORT_VER="1.2.2"
ARG BWAMEM2_VER="2.2.1"
ARG HISTAT2_VER="2.2.1"
ARG SPARSEHASH_VER="2.0.4"
ARG SDSL_VER="2.1.1"
ARG BTLBLOOMFILTER_VER="1.2.1"
ARG BIOBLOOM_VER="2.3.5"
# Base image for building
FROM ubuntu:jammy AS builder
ARG HOCORT_VER
ARG BWAMEM2_VER
ARG HISTAT2_VER
ARG SPARSEHASH_VER
ARG SDSL_VER
ARG BTLBLOOMFILTER_VER
ARG BIOBLOOM_VER
# Set non-interactive mode
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential g++ unzip gcc git wget curl make \
libboost-all-dev libbz2-dev liblzma-dev libcurl4-gnutls-dev \
libssl-dev zlib1g-dev cmake python3.10 python3-pip \
bowtie2 kraken2 bwa minimap2 samtools bbmap doxygen \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# # BWA-MEM2 installation
RUN git clone --recursive https://github.com/bwa-mem2/bwa-mem2.git /bwa-mem2-${BWAMEM2_VER} && \
cd bwa-mem2-${BWAMEM2_VER} && \
make -j$(nproc) && \
cp bwa-mem2* /usr/local/bin && \
cd ../ && rm -rf bwa-mem2-${BWAMEM2_VER}
# HISAT2 installation
RUN wget -q https://github.com/DaehwanKimLab/hisat2/archive/refs/tags/v${HISTAT2_VER}.tar.gz && \
tar -xzf v${HISTAT2_VER}.tar.gz && \
cd hisat2-${HISTAT2_VER} && make -j$(nproc) && \
cp hisat2 hisat2-build /usr/local/bin/ && \
cd .. && rm -rf hisat2-${HISTAT2_VER} v${HISTAT2_VER}.tar.gz
# # Install sparsehash
RUN wget https://github.com/sparsehash/sparsehash/archive/refs/tags/sparsehash-${SPARSEHASH_VER}.tar.gz && \
tar -xvzf sparsehash-${SPARSEHASH_VER}.tar.gz && \
cd sparsehash-sparsehash-${SPARSEHASH_VER} && \
./configure && \
make && \
make install && \
cd ../ && \
rm -rf sparsehash-${SPARSEHASH_VER}.tar.gz sparsehash-sparsehash-${SPARSEHASH_VER}
# Clone and build SDSL-lite
RUN git clone --recursive https://github.com/simongog/sdsl-lite.git /sdsl-lite-${SDSL_VER} && \
cd /sdsl-lite-${SDSL_VER} && \
git submodule update --init --recursive && \
mkdir -p build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
cd ../ && \
rm -rf /sdsl-lite-${SDSL_VER}
# Install BTL Bloom filter
RUN git clone https://github.com/bcgsc/btl_bloomfilter.git /btl_bloomfilter-${BTLBLOOMFILTER_VER} && \
cd btl_bloomfilter-${BTLBLOOMFILTER_VER} && \
chmod +x autogen.sh && \
./autogen.sh && \
./configure && \
make && make install && \
mkdir -p /usr/local/include/btl_bloomfilter && \
cp -r *.hpp vendor /usr/local/include/btl_bloomfilter && \
cd .. && rm -rf btl_bloomfilter-${BTLBLOOMFILTER_VER}
# # Install BioBloom
RUN wget https://github.com/bcgsc/biobloom/archive/refs/tags/${BIOBLOOM_VER}.tar.gz && \
tar -xvzf ${BIOBLOOM_VER}.tar.gz && \
cd biobloom-${BIOBLOOM_VER} && \
chmod +x autogen.sh && \
./autogen.sh && \
./configure CXXFLAGS="-I/usr/local/include/btl_bloomfilter" LDFLAGS="-L/usr/local/lib" && \
make && make install && \
cd ../ && rm -rf ${BIOBLOOM_VER}.tar.gz biobloom-${BIOBLOOM_VER}
# Install HoCoRT
RUN wget -q https://github.com/ignasrum/hocort/archive/refs/tags/${HOCORT_VER}.tar.gz && \
tar -xzf ${HOCORT_VER}.tar.gz && cd hocort-${HOCORT_VER} && \
pip3 install --no-cache-dir . && cd .. && \
rm -rf hocort-${HOCORT_VER} ${HOCORT_VER}.tar.gz
# Final stage: Application image
FROM ubuntu:jammy AS app
ARG HOCORT_VER
ARG BWAMEM2_VER
ARG HISTAT2_VER
ARG SPARSEHASH_VER
ARG SDSL_VER
ARG BTLBLOOMFILTER_VER
ARG BIOBLOOM_VER
# Set up labels
LABEL base.image="ubuntu:jammy" \
dockerfile.version="1" \
software="HoCoRT" \
software.version=${HOCORT_VER} \
description="Remove specific organisms from sequencing reads." \
website="https://github.com/ignasrum/hocort" \
license.url="https://github.com/ignasrum/hocort?tab=MIT-1-ov-file#readme" \
maintainer="Taylor K. Paisie" \
maintainer.email="ltj8@cdc.gov"
# Copy runtime files
COPY --from=builder /usr/ /usr/
# Set up working directory
WORKDIR /data
CMD ["hocort", "--help"]
# Optional: Test stage
FROM app AS test
# Verify installation
RUN hocort --version && hocort --help
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates curl && \
mkdir test && \
curl -L -o test/genome.fna https://raw.githubusercontent.com/ignasrum/hocort/main/tests/test_data/fasta/genome.fna && \
hocort index bowtie2 --input test/genome.fna --output test/hocort_test && \
rm -rf /var/lib/apt/lists/*