forked from copy/v86
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
215 lines (166 loc) · 9.44 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
FROM i386/debian:bookworm-20230904-slim
WORKDIR /root/build
# ------------------------------------------------------------------------------
# Config
# ------------------------------------------------------------------------------
ENV INSTALL_DIR=/usr/local/bin
ENV DEBIAN_FRONTEND noninteractive
# ------------------------------------------------------------------------------
# Base image
# ------------------------------------------------------------------------------
RUN <<BASE_IMAGE
apt update && \
apt --yes --no-install-recommends install \
linux-image-686 grub2 systemd libterm-readline-perl-perl locales && \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
locale-gen && \
echo 'LANG="en_US.UTF-8"' > /etc/default/locale && \
chsh -s /bin/bash && \
echo "root:root" | chpasswd && \
mkdir -p /etc/systemd/system/serial-getty@ttyS0.service.d/ && \
systemctl enable serial-getty@ttyS0.service && \
rm /lib/systemd/system/getty.target.wants/getty-static.service && \
rm /etc/motd /etc/issue && \
systemctl disable systemd-timesyncd.service && \
systemctl disable apt-daily.timer && \
systemctl disable apt-daily-upgrade.timer && \
systemctl disable dhcpcd.service && \
echo "tmpfs /tmp tmpfs nodev,nosuid 0 0" >> /etc/fstab
# Re-enable man pages (not there by default since using a slim version of the Debian Docker image)
sed -i "s|path-exclude /usr/share/man/\*||" /etc/dpkg/dpkg.cfg.d/docker
# General utilities
apt --yes --no-install-recommends install vim nano less curl git man-db \
ca-certificates make cmake autoconf libbz2-dev liblzma-dev libncurses5-dev \
zlib1g-dev libcurl4-gnutls-dev libssl-dev gcc g++ libc6-dev autotools-dev \
automake libtool build-essential zlib1g
BASE_IMAGE
# Install Rust. It's needed by tools like MMSeqs2 and Foldseek, but "apt-get install -y rustc" installs a version that is too old.
COPY --from=i386/rust:1.72-slim-bookworm /usr/local/rustup /usr/local/rustup
COPY --from=i386/rust:1.72-slim-bookworm /usr/local/cargo /usr/local/cargo
ENV RUSTUP_HOME=/usr/local/rustup
ENV CARGO_HOME=/usr/local/cargo
ENV PATH=/usr/local/cargo/bin:$PATH
# ------------------------------------------------------------------------------
# Bioinformatics tools - sandbox.bio v1
# ------------------------------------------------------------------------------
RUN apt-get install -y jq tree seqtk fasttree kalign bedtools
# Htslib: disabled features that depend on the network; modified CFLAGS to remove "-g"
RUN git clone --recursive --branch 1.18 https://github.com/samtools/htslib.git && cd htslib && \
autoreconf -i && ./configure --disable-plugins --disable-libcurl --disable-gcs --disable-s3 && \
make CFLAGS="-O2 -fvisibility=hidden" && make install
# samtools: apt-get version is 1.16.1; modified CFLAGS to remove "-g"
RUN git clone --recursive --branch 1.18 https://github.com/samtools/samtools.git && cd samtools && \
autoheader && autoconf -Wno-syntax && ./configure && make CFLAGS="-O2" && make install
# bcftools (the apt-get version is 1.16; modified CFLAGS to remove "-g"
RUN git clone --recursive --branch 1.18 https://github.com/samtools/bcftools.git && cd bcftools && \
autoheader && autoconf && ./configure --disable-bcftools-plugins --disable-libgsl --disable-perl-filters && \
make CFLAGS="-O2" && make install
# fastp (using older version since latest needs libisal, which gives 32-bit errors)
RUN git clone --branch v0.20.1 https://github.com/OpenGene/fastp.git && cd fastp && \
make LD_FLAGS="-lz -lpthread -static" && make install
# Bowtie2
RUN git clone --branch v2.5.1 https://github.com/BenLangmead/bowtie2.git && cd bowtie2 && \
sed -i "s/BITS := 32/BITS := 64/" Makefile && make SSE_FLAG="-msse2" && make install
# Minimap2 (manual install because "apt-get install -y minimap2" gives opcode errors)
RUN apt update
RUN git clone --recursive --branch v2.26 https://github.com/lh3/minimap2.git && cd minimap2 && \
make && install minimap2 ${INSTALL_DIR}
# ------------------------------------------------------------------------------
# Bioinformatics tools - sandbox.bio v2
# ------------------------------------------------------------------------------
RUN apt-get install -y jellyfish seqkit kraken2 mummer libxml2-utils procps
# CSVtk
RUN curl -L -O "https://github.com/shenwei356/csvtk/releases/download/v0.27.2/csvtk_linux_386.tar.gz" && \
tar xvzf "csvtk_linux_386.tar.gz" && install csvtk ${INSTALL_DIR}
# Kallisto (using 0.48.0 because get build error with 0.50.0)
# This version uses an older htslib that breaks with autoconf >2.69, so cherry pick just that fix
RUN git clone --branch v0.48.0 https://github.com/pachterlab/kallisto.git && cd kallisto && \
git cherry-pick -n 94e00d9a924345a26f03ccbb561b1d3bd4165712 -X theirs && \
mkdir build && cd build && cmake -DLINK=static .. && make && make install && cd ../../
# MMSeqs2 (CMake flags: https://github.com/soedinglab/MMseqs2/wiki#customizing-compilation-through-cmake)
RUN git clone --recursive --branch 14-7e284 https://github.com/soedinglab/MMseqs2.git && cd MMseqs2 && \
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=RELEASE -DHAVE_TESTS=0 -DREQUIRE_OPENMP=0 -DNATIVE_ARCH=0 -DHAVE_SSE2=1 .. && \
make && make install
# Foldseek
RUN git clone --recursive --branch 8-ef4e960 https://github.com/steineggerlab/foldseek && cd foldseek && \
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=RELEASE -DHAVE_TESTS=0 -DREQUIRE_OPENMP=0 -DNATIVE_ARCH=0 -DHAVE_SSE2=1 .. && \
make && make install
# ViralConsensus
RUN git clone --branch 0.0.4 https://github.com/niemasd/ViralConsensus.git && cd ViralConsensus && \
make && install viral_consensus ${INSTALL_DIR}
# HyPhy
RUN git clone --branch 2.5.59 https://github.com/veg/hyphy.git && cd hyphy && \
cmake . && make install
# FreeBayes: compile from source and compile into static (otherwise, get 20 .bin files)
RUN apt-get install -y meson ninja-build pkg-config
RUN git clone --branch v1.3.7 --recursive https://github.com/freebayes/freebayes.git && cd freebayes && \
meson build -Dstatic=true -Dprefer_system_deps=false --buildtype release && cd build && ninja && \
install freebayes ${INSTALL_DIR}/freebayes
# vcfdist
RUN git clone --branch v2.5.3 https://github.com/timd1/vcfdist && cd vcfdist/src && \
make && make install
# SKA2 (requires Rust > 1.74)
COPY --from=i386/rust:1.83.0-slim-bookworm /usr/local/rustup /usr/local/rustup
COPY --from=i386/rust:1.83.0-slim-bookworm /usr/local/cargo /usr/local/cargo
RUN cargo install ska --target i686-unknown-linux-gnu --jobs 5
RUN install /usr/local/cargo/bin/ska ${INSTALL_DIR}/ska
# Biopython
RUN apt-get update -y && apt-get install -y --no-install-suggests python3-biopython
# MAFFT
RUN apt-get install -y mafft
# lsd2
RUN git clone --branch v.2.4.1 https://github.com/tothuhien/lsd2.git && cd lsd2/src && \
make && install lsd2 ${INSTALL_DIR}
# IQ-TREE2
RUN apt-get install -y iqtree
# Plink
RUN apt-get install -y plink1.9
# Newick utils
RUN apt-get install -y bison flex && \
git clone https://github.com/tjunier/newick_utils.git && cd newick_utils && \
autoreconf -fi && \
CFLAGS="-fcommon" CXXFLAGS="-fcommon" ./configure --prefix=/usr && \
make -j4 && \
make install
# Numlist for quick calculations on lists of numbers
RUN git clone https://github.com/niemasd/tools.git && cd tools && \
make numlist && install numlist ${INSTALL_DIR}
# ------------------------------------------------------------------------------
# Utilities
# ------------------------------------------------------------------------------
RUN apt-get remove -y vim && \
apt-get install -y vim-tiny && \
install /usr/bin/vim.tiny ${INSTALL_DIR}/vim
# ------------------------------------------------------------------------------
# Custom sandbox.bio commands
# ------------------------------------------------------------------------------
COPY sandbox_bio_open.sh /root/build/open
COPY sandbox_bio_download.sh /root/build/download
COPY sandbox_bio_curl.sh /root/build/curl
RUN apt-get remove -y curl && \
install /root/build/open ${INSTALL_DIR}/open && \
install /root/build/download ${INSTALL_DIR}/download && \
install /root/build/curl ${INSTALL_DIR}/curl
# ------------------------------------------------------------------------------
# Setup
# ------------------------------------------------------------------------------
# Fix manpage issue
RUN apt-get install -y --reinstall coreutils grep
# Setup
WORKDIR /root/
RUN rm -rf /root/build && \
mkdir /root/tutorial && \
echo "alias ll='ls -latrsh';" >> /root/.bashrc
COPY getty-noclear.conf getty-override.conf /etc/systemd/system/getty@tty1.service.d/
COPY getty-autologin-serial.conf /etc/systemd/system/serial-getty@ttyS0.service.d/
COPY logind.conf /etc/systemd/logind.conf
COPY boot-9p /etc/initramfs-tools/scripts/boot-9p
RUN printf '%s\n' 9p 9pnet 9pnet_virtio virtio virtio_ring virtio_pci | tee -a /etc/initramfs-tools/modules && \
echo 'BOOT=boot-9p' | tee -a /etc/initramfs-tools/initramfs.conf && \
update-initramfs -u && \
rustup self uninstall -y && \
apt-get remove --purge -y gcc gcc-12 g++ make cmake automake autoconf build-essential libbz2-dev liblzma-dev libncurses5-dev zlib1g-dev libcurl4-gnutls-dev libssl-dev libc6-dev autotools-dev libtool python3-pip pandoc meson ninja-build pkg-config bison flex && \
apt-get autoremove --purge -y && \
apt-get --yes clean && \
rm -r /var/lib/apt/lists/* && \
rm /var/log/*.log /var/log/lastlog /var/log/wtmp /var/log/apt/*.log /var/log/apt/*.xz