Skip to content

Commit

Permalink
Merge pull request #79 from sanger-pathogens/add_dockerfile
Browse files Browse the repository at this point in the history
Dockerfile: peg samtools version and downgrade to 0.1.19
  • Loading branch information
trstickland authored Feb 19, 2020
2 parents a133ac3 + 8912d69 commit 6896bb5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
27 changes: 25 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ FROM ubuntu:18.04
ARG DEBIAN_FRONTEND=noninteractive
ARG BUILD_DIR=/opt/fastaq

ARG SAMTOOLS_VERSION=0.1.19
ENV SAMTOOLS_URL=https://github.com/samtools/samtools/archive/${SAMTOOLS_VERSION}.tar.gz
ENV SAMTOOLS_DIR=/usr/local/samtools-${SAMTOOLS_VERSION}

# Install the dependancies
RUN apt-get update && \
apt-get install --yes apt-utils && \
apt-get --yes upgrade && \
apt-get install --yes python3 python3-pip samtools
apt-get install --yes curl python3 python3-pip

RUN apt-get install -y locales && \
sed -i -e 's/# \(en_GB\.UTF-8 .*\)/\1/' /etc/locale.gen && \
Expand All @@ -17,8 +21,27 @@ ENV LANG en_GB.UTF-8
ENV LANGUAGE en_GB:en
ENV LC_ALL en_GB.UTF-8

COPY . ${BUILD_DIR}
# samtools build
# nore specific version requirement
RUN apt-get install --yes libncurses5-dev libz-dev
RUN mkdir -p ${SAMTOOLS_DIR} && \
cd ${SAMTOOLS_DIR} && \
curl -fsSL ${SAMTOOLS_URL} | tar xzf - --strip-components=1 && \
echo -n "Building samtools... " && \
make > make.log 2>&1; \
EXIT=$?; \
if [ $? -ne ${EXIT} ]; then echo "FAILED:" && cat make.log && exit ${EXIT}; else echo "OK."; fi
ENV PATH ${SAMTOOLS_DIR}:${SAMTOOLS_DIR}/misc:${PATH}

# check samtools is an executable in the path
RUN samtools 2> /tmp/samtools.out; \
EXIT=$?; \
if [ 1 -ne ${EXIT} ]; then \
cat /tmp/samtools.out && exit ${EXIT}; \
fi;

# Fastaq build
COPY . ${BUILD_DIR}
RUN cd ${BUILD_DIR} && \
python3 setup.py test && \
python3 setup.py install && \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The test can be run from the top level directory:
### Runtime dependencies

These must be available in your path at run time:
* samtools
* samtools 0.1.19
* gzip
* gunzip

Expand Down

0 comments on commit 6896bb5

Please sign in to comment.