Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile independent from debian package #226

Merged
merged 2 commits into from
Jul 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 70 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,73 @@
#
# From this base-image / starting-point
#
FROM debian:testing
# Use a LTS Ubuntu version as parent image
FROM ubuntu:16.04
ARG DEBIAN_FRONTEND=noninteractive
ARG PYTHONWARNINGS="ignore:Unverified HTTPS request"
ENV LD_LIBRARY_PATH='/usr/local/lib'
WORKDIR /opt

#
# Authorship
#
MAINTAINER ap13@sanger.ac.uk
# Install general dependencies
RUN apt-get update && apt-get install --no-install-recommends -y \
curl \
make \
automake \
gcc \
pkg-config \
zlib1g-dev \
autoconf \
check \
libtool \
libsubunit-dev \
git \
python3 \
python3-dev \
python3-setuptools \
python3-pip

#
# Pull in packages from testing
#
RUN apt-get update -qq
# Install python dependencies
RUN pip3 install --trusted-host pypi.python.org --upgrade pip
RUN pip3 install certifi \
&& pip3 install wheel \
&& pip3 install nose \
&& pip3 install pillow \
&& pip3 install dendropy \
&& pip3 install biopython

# Install RAxML
ARG raxml_version='8.2.12'
RUN curl -L https://github.com/stamatak/standard-RAxML/archive/v${raxml_version}.tar.gz -o standard-RAxML-${raxml_version}.tar.gz \
&& tar xzf standard-RAxML-${raxml_version}.tar.gz \
&& cd standard-RAxML-${raxml_version} \
&& make -f Makefile.gcc \
&& make -f Makefile.PTHREADS.gcc \
&& cp raxmlHPC /usr/local/bin/ \
&& cp raxmlHPC-PTHREADS /usr/local/bin/ \
&& cd .. \
&& rm -rf standard-RAxML-${raxml_version}

#
# Install Roary
#
RUN apt-get install -y gubbins
# Install FastTree
ARG fasttree_version='2.1.10'
RUN curl http://www.microbesonline.org/fasttree/FastTree-${fasttree_version}.c -o FastTree.c \
&& gcc -O3 -finline-functions -funroll-loops -Wall -o FastTree FastTree.c -lm \
&& mv FastTree /usr/local/bin/ \
&& rm FastTree.c

# Install IQTree
ARG iqtree_version='1.6.6'
RUN curl -L https://github.com/Cibiv/IQ-TREE/releases/download/v${iqtree_version}/iqtree-${iqtree_version}-Linux.tar.gz -o iqtree-${iqtree_version}-Linux.tar.gz \
&& tar xzf iqtree-${iqtree_version}-Linux.tar.gz \
&& cp iqtree-${iqtree_version}-Linux/bin/iqtree /usr/local/bin \
&& rm -rf iqtree-${iqtree_version}-Linux

# Install Gubbins
RUN git clone https://github.com/sanger-pathogens/gubbins.git \
&& cd gubbins \
&& autoreconf -i \
&& ./configure \
&& make \
&& make check \
&& make install \
&& cd python \
&& python3 setup.py install

# Rename executable for backwards compatibility
RUN mv /usr/local/bin/run_gubbins.py /usr/local/bin/run_gubbins
39 changes: 23 additions & 16 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Before you do anything, please have a look at the [Gubbins webpage](http://sanger-pathogens.github.io/gubbins/).

# Installation
There are a few ways to install Gubbins and its dependancies. The simpliest way is using conda.
There are a few ways to install Gubbins and its dependencies. The simpliest way is using conda.

* OSX/Linux - Bioconda
* Linux - Ubuntu Xenial (16.04) & Debian (unstable)
Expand All @@ -22,42 +22,49 @@ conda install gubbins

## Linux - Ubuntu Xenial (16.04) & Debian (unstable)
Gubbins has been packaged by the Debian Med team and is trivial to install using apt.
```
sudo apt-get install gubbins
```

sudo apt-get install gubbins

## OSX/Linux/Cloud/Windows - Docker
We have a docker container which gets automatically built from the latest version of Gubbins in Debian Med. To install it:

```
docker pull sangerpathogens/gubbins
```
docker pull sangerpathogens/gubbins

To use it you would use a command such as this:

docker run --rm -it -v <local_dir>:<remote_dir> sangerpathogens/gubbins run_gubbins -p <remote_dir>/<prefix> [<options>] <remote_dir>/<alignment_file>

The flag `-v` synchronizes a directory on the host machine (here denoted as `<local_dir>`) with a directory in the Docker container (here denoted as `<remote_dir>`).
`<remote_dir>` does not need to exist in the container before the run, a common choice is `/data`.
Note that both `<local_dir>` and `<remote_dir>` must be absolute paths.

The input alignment file must be present in `<local_dir>` (or in one of its subdirectories).
In order to retrieve the files produced by Gubbins, run the program with option `-p`;
the argument of this option must consist of `<remote_dir>`, followed by an arbitrary identifier (here denoted as `<prefix>`).

To use it you would use a command such as this (substituting in your directories), where your input files are assumed to be stored in /home/ubuntu/data:
```
docker run --rm -it -v /home/ubuntu/data:/data sangerpathogens/gubbins run_gubbins --help
```

## OSX/Linux - from source
This is the most difficult method and is only suitable for someone with advanced computing skills. Please consider using Conda instead.

Install the dependances and include them in your PATH:
Install the dependencies and include them in your `PATH`:
* [FastTree](http://www.microbesonline.org/fasttree/#Install) ( >=2.1.4 )
* [RAxML](https://github.com/stamatak/standard-RAxML) ( >=8.0 )
* Python modules: Biopython (> 1.59), DendroPy (>=4.0), Reportlab, nose, pillow
* Standard build environment tools (e.g. python3, pip3, make, autoconf, libtool, gcc, check, etc...)

Clone or download the source code from GitHub and run the following commands to install Gubbins:
```
autoreconf -i
./configure
./configure [--prefix=$PREFIX]
make
sudo make install
[sudo] make install
cd python
sudo python3 setup.py install
[sudo] python3 setup.py install
```
Use `sudo` to install Gubbins system-wide. If you don't have the permissions, run `configure` with a prefix to install Gubbins in your home directory.

## OSX/Linux/Windows - Virtual Machine
Roary wont run natively on Windows but we have created virtual machine which has all of the software setup, along with the test datasets from the paper.
Roary wont run natively on Windows but we have created a virtual machine which has all of the software setup, along with the test datasets from the paper.
It is based on [Bio-Linux 8](http://environmentalomics.org/bio-linux/). You need to first install [VirtualBox](https://www.virtualbox.org/),
then load the virtual machine, using the 'File -> Import Appliance' menu option. The root password is 'manager'.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.2
2.3.3