Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
Add Dockerfiles with zlib-ng
Browse files Browse the repository at this point in the history
- vibsinglecellnf/samtools:base-0.1 has zlib-ng and libdeflate on a
debian base image
- vibsinglecellnf/samtools:1.12 uses the base-0.1 image, and includes
htslib and samtools
- #325
  • Loading branch information
cflerin committed Mar 25, 2021
1 parent 64a4c4e commit 6f9bad0
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
47 changes: 47 additions & 0 deletions src/samtools/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM vibsinglecellnf/samtools:base-0.1

ENV DEBIAN_FRONTEND=noninteractive
RUN BUILDPKGS="git \
autoconf \
automake \
perl \
zlib1g-dev \
libbz2-dev \
liblzma-dev \
libcurl4-openssl-dev \
libssl-dev \
bedtools \
libncurses5-dev" && \
apt-get update && \
apt-get install -y --no-install-recommends $BUILDPKGS

# install htslib
# Include fix so HTSlib works with zlib-ng: https://github.com/samtools/htslib/compare/develop...jkbonfield:zlib-ng-fix
ENV HTSLIB_VERSION 1.12
RUN curl -L -o /tmp/htslib-${HTSLIB_VERSION}.tar.bz2 \
https://github.com/samtools/htslib/releases/download/${HTSLIB_VERSION}/htslib-${HTSLIB_VERSION}.tar.bz2 && \
mkdir -p /tmp/htslib-${HTSLIB_VERSION} && \
tar jxvf /tmp/htslib-${HTSLIB_VERSION}.tar.bz2 -C /tmp/htslib-${HTSLIB_VERSION} --strip-components 1 && \
cd /tmp/htslib-${HTSLIB_VERSION} && \
curl -L -O https://raw.githubusercontent.com/jkbonfield/htslib/715056cdd3f85855a503ac932f58e84b92c7dd0e/bgzf.c && \
./configure \
CFLAGS="-fPIC" && \
make && \
make install && \
cd .. && rm -rf htslib-${HTSLIB_VERSION}*

# install samtools
ENV SAMTOOLS_VERSION 1.12
RUN curl -L -o /tmp/samtools-${SAMTOOLS_VERSION}.tar.bz2 \
https://github.com/samtools/samtools/releases/download/${SAMTOOLS_VERSION}/samtools-${SAMTOOLS_VERSION}.tar.bz2 && \
mkdir -p /tmp/samtools-${SAMTOOLS_VERSION} && \
tar jxvf /tmp/samtools-${SAMTOOLS_VERSION}.tar.bz2 -C /tmp/samtools-${SAMTOOLS_VERSION} --strip-components 1 && \
cd /tmp/samtools-${SAMTOOLS_VERSION} && \
./configure && \
make && \
make install && \
cd .. && rm -rf samtools-${SAMTOOLS_VERSION}*

RUN rm -rf /var/cache/apt/* && \
rm -rf /var/lib/apt/lists/*

37 changes: 37 additions & 0 deletions src/samtools/Dockerfile.samtools-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM debian:buster-slim

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
apt-utils debconf locales locales-all && \
dpkg-reconfigure locales && \
apt-get install -y --reinstall ca-certificates && \
apt-get install -y --no-install-recommends \
cmake \
make \
gcc \
libbz2-dev \
zlib1g-dev \
liblzma-dev \
libdeflate-dev \
bzip2 \
pigz \
curl \
procps \
less

# zlib-ng
ENV ZLIBNG 2.0.2
RUN curl -L -o /tmp/zlib-ng-${ZLIBNG}.tar.gz https://github.com/zlib-ng/zlib-ng/archive/refs/tags/${ZLIBNG}.tar.gz && \
cd /tmp && tar xvf zlib-ng-${ZLIBNG}.tar.gz && \
cd zlib-ng-${ZLIBNG} && \
cmake -DZLIB_COMPAT=ON -DINSTALL_UTILS=ON . && \
cmake --build . --config Release && \
ctest --verbose -C Release && \
cmake --build . --target install && \
cd .. && rm -r zlib-ng-${ZLIBNG}*

RUN rm -rf /var/cache/apt/* && \
rm -rf /var/lib/apt/lists/* && \
ldconfig

0 comments on commit 6f9bad0

Please sign in to comment.