tseemann / prokka

:zap: :aquarius: Rapid prokaryotic genome annotation
843 stars 226 forks source link

feature request: official prokka Docker image and Dockerfile #459

Closed evanbiederstedt closed 4 years ago

evanbiederstedt commented 4 years ago

Hi @tseemann

As a feature request, I wonder if there could be an "official" versioned Docker image associated with prokka. It appears there are dozens of versions at Dockerhub already.

I appear to be using the Docker image more and more, as it avoids all of my Perl/brew disasters.

As for the Dockerfiles, it appears many have them up already:

https://hub.docker.com/r/staphb/prokka/dockerfile

FROM ubuntu:xenial

LABEL base.image="ubuntu:xenial"
LABEL version="1.1.0"
LABEL software="Prokka"
LABEL software.version="1.14.0"
LABEL description="Automated prokaryotic genome annotation tool"
LABEL website="https://github.com/tseemann/prokka"
LABEL license="https://github.com/tseemann/prokka#licence"
LABEL maintainer="Curtis Kapsak"
LABEL maintainer.email="pjx8@cdc.gov"

# install dependencies
RUN apt-get update && apt-get -y --no-install-recommends install \
 bzip2 \
 gzip \
 wget \
 perl \
 less \
 libdatetime-perl \
 libxml-simple-perl \
 libdigest-md5-perl \
 default-jre \
 bioperl \
 hmmer \
 zlib1g-dev \
 python \
 liblzma-dev \
 libbz2-dev \
 xz-utils \ 
 curl \
 g++ \
 make && apt-get clean && apt-get autoclean && rm -rf /var/lib/apt/lists/*

# install bedtools 2.29.0 since >=2.27.0 is required for barrnap and the apt-get package is 2.25.0
# dependencies required for bedtools: zlib1g-dev python liblzma-dev libbz2-dev xz-utils curl g++
RUN wget https://github.com/arq5x/bedtools2/releases/download/v2.29.0/bedtools-2.29.0.tar.gz && \
  tar -zxf bedtools-2.29.0.tar.gz && \
  rm bedtools-2.29.0.tar.gz && \
  cd bedtools2 && \
  make

# add bedtools to PATH for barrnap test
ENV PATH="$PATH:/bedtools2/bin"

# install barrnap
RUN wget https://github.com/tseemann/barrnap/archive/0.9.tar.gz && \
    tar -zxf 0.9.tar.gz && \
    rm 0.9.tar.gz && \
    cd barrnap-0.9 && \
    make test

RUN wget https://github.com/tseemann/prokka/archive/v1.14.0.tar.gz && \
    tar -xzf v1.14.0.tar.gz && \
    rm -rf v1.14.0.tar.gz && \
    mkdir /data

# install tbl2asn manually since the one included with prokka is expired.
# Probably will have to do again in Jan 2021 unless Torsten removes it from prokka
RUN wget ftp://ftp.ncbi.nih.gov/toolbox/ncbi_tools/converters/by_program/tbl2asn/linux64.tbl2asn.gz -O linux64.tbl2asn.gz && \
    gunzip linux64.tbl2asn.gz && \
    mv linux64.tbl2asn /usr/bin/tbl2asn && \
    chmod 755 /usr/bin/tbl2asn

# set PATH to prioritize /usr/bin/tbl2asn before /prokka-[VERSION]/binaries/*/tbl2asn
ENV PATH="$PATH:/prokka-1.14.0/bin:\
/barrnap-0.9/bin"

# set perl locale settings so barrnap works in singularity image
ENV LC_ALL=C

RUN prokka --setupdb && prokka --listdb
WORKDIR /data

I could do a PR, but I'm not sure you would be interested in such a scheme, or the maintaining newer versions.

kapsakcj commented 4 years ago

My guess is that Torsten doesn't want to maintain yet another thing.....but myself and the other members in the StaPH-B group are happy to maintain the above dockerfile (and future Prokka releases) since Prokka is such an important tool to us. Won't be "official Torstyverse" but it seems to work well for everyone that uses our docker images.

There should be a docker image automatically created for every (bio)conda recipe on quay.io via the biocontainers project. But there have been reports of the tbl2asn binary being "expired" and causing prokka to fail when installed with conda, which would likely affect the biocontainers. https://quay.io/repository/biocontainers/prokka?tab=tags

If you have any issues/suggestions/feedback on our StaPH-B docker images, leave us an issue https://github.com/StaPH-B/docker-builds

evanbiederstedt commented 4 years ago

Hi @kapsakcj

That would totally work for me!

In that case, it's a conversation between you and @tseemann. A link on the README should work...

In my situation, I just always use a Docker image. If anything changes between blast/prokka/brew,/perl, I try to re-install stuff---I could spend so much time on that.

Just using an official Docker image takes seconds.

tseemann commented 4 years ago

@kapsakcj

kapsakcj commented 4 years ago

Sounds great! Feel free to add the link and example commands on the README. Here's the (static) link to the dockerhub repository for Prokka https://hub.docker.com/r/staphb/prokka

To download the docker image:

# default tag will download the latest available docker image of Prokka
docker pull staphb/prokka:latest
# Or a Prokka-version-specific tag
docker pull staphb/prokka:1.14.5

# then
docker run staphb/prokka:latest prokka -h

The StaPH-B prokka docker images also work in Singularity. To download and convert docker image to singularity image format:

singularity build prokka.sif docker://staphb/prokka:latest

singularity exec prokka.sif prokka -h
evanbiederstedt commented 4 years ago

I think the above in the README would be quite helpful. Thanks @kapsakcj!

tseemann commented 4 years ago

Done in https://github.com/tseemann/prokka/commit/4dd164fd6d3b86dda105b75bfd93577c2e0bb82b

evanbiederstedt commented 4 years ago

Thanks @kapsakcj and @tseemann! I appreciate the help