|
| 1 | +FROM staphb/kma:1.6.4 AS kma |
| 2 | + |
| 3 | +FROM ubuntu:noble AS app |
| 4 | + |
| 5 | +# set env to avoid /.gitconfig permission error on AWS |
| 6 | +ENV HOME=/root |
| 7 | + |
| 8 | +ARG PLASMIDFINDER_VER="3.0.3" |
| 9 | + |
| 10 | +LABEL base.image="ubuntu:noble" |
| 11 | +LABEL dockerfile.version="1" |
| 12 | +LABEL software="plasmidfinder" |
| 13 | +LABEL software.version="${PLASMIDFINDER_VER}" |
| 14 | +LABEL description="Identifies plasmids in total or partial sequenced isolates of bacteria." |
| 15 | +LABEL website="https://bitbucket.org/genomicepidemiology/plasmidfinder" |
| 16 | +LABEL license="https://bitbucket.org/genomicepidemiology/plasmidfinder/src/master/README.md" |
| 17 | +LABEL maintainer="Kutluhan Incekara" |
| 18 | +LABEL maintainer.email="kutluinct@gmail.com" |
| 19 | +LABEL maintainer2="Erin Young" |
| 20 | +LABEL maintainer2.email="eriny@utah.gov" |
| 21 | + |
| 22 | +# install dependencies; cleanup apt garbage |
| 23 | +# ncbi-blast+ v2.12.0 (ubuntu:jammy), min required version is 2.8.1 |
| 24 | +# python3 v3.10.12, min required version is 3.10 |
| 25 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 26 | + wget \ |
| 27 | + ca-certificates \ |
| 28 | + procps \ |
| 29 | + ncbi-blast+ \ |
| 30 | + python3-pip \ |
| 31 | + git \ |
| 32 | + python-is-python3 && \ |
| 33 | + apt-get autoclean && rm -rf /var/lib/apt/lists/* && \ |
| 34 | + update-alternatives --install /usr/bin/python python /usr/bin/python3 10 |
| 35 | + |
| 36 | +COPY --from=kma /usr/local/bin/* /usr/local/bin/ |
| 37 | + |
| 38 | +# download plasmindfinder database |
| 39 | +RUN git clone -b plasmidfinder-${PLASMIDFINDER_VER} --depth 1 https://bitbucket.org/genomicepidemiology/plasmidfinder_db.git &&\ |
| 40 | + cd plasmidfinder_db &&\ |
| 41 | + python INSTALL.py &&\ |
| 42 | + rm -rf .git |
| 43 | + |
| 44 | +# install plasmidfinder to specific tag/version; make /data |
| 45 | +RUN pip3 install --no-cache-dir --break-system-packages PlasmidFinder==${PLASMIDFINDER_VER} && \ |
| 46 | + mkdir /data |
| 47 | + |
| 48 | +# set $PATH and locale settings for singularity compatibility |
| 49 | +ENV PATH="${PATH}" \ |
| 50 | + LC_ALL=C.UTF-8 \ |
| 51 | + CGE_BLASTN=/usr/bin/blastn \ |
| 52 | + CGE_PLASMIDFINDER_DB=/plasmidfinder_db \ |
| 53 | + PLASMID_DB=/plasmidfinder_db |
| 54 | + |
| 55 | +# set final working directory for production docker image (app layer only) |
| 56 | +WORKDIR /data |
| 57 | + |
| 58 | +# default command is to pull up help options for virulencefinder |
| 59 | +CMD ["python", "-m", "plasmidfinder", "-h"] |
| 60 | + |
| 61 | +### START OF TEST STAGE ### |
| 62 | +FROM app AS test |
| 63 | + |
| 64 | +RUN python -m plasmidfinder -h |
| 65 | + |
| 66 | +RUN wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR193/000/ERR1937840/ERR1937840.fastq.gz && \ |
| 67 | + gzip -d ERR1937840.fastq.gz && mkdir test && \ |
| 68 | + python -m plasmidfinder -i ERR1937840.fastq -o test |
0 commit comments