|
| 1 | +FROM mambaorg/micromamba:2.5.0 AS app |
| 2 | + |
| 3 | +# build and run as root users since micromamba image has 'mambauser' set as the $USER |
| 4 | +USER root |
| 5 | +# set workdir to default for building; set to /data at the end |
| 6 | +WORKDIR / |
| 7 | + |
| 8 | +# ARG sets environment variables during the build stage |
| 9 | +ARG NGMASTER_VER="1.1.1" |
| 10 | +ARG MLST_VER="2.23.0" |
| 11 | +ARG ANY2FASTA_VER="0.8.1" |
| 12 | + |
| 13 | +LABEL base.image="mambaorg/micromamba:2.5.0" |
| 14 | +LABEL dockerfile.version="1" |
| 15 | +LABEL software="ngmaster" |
| 16 | +LABEL software.version=${NGMASTER_VER} |
| 17 | +LABEL description="In silico multi-antigen sequence typing for Neisseria gonorrhoeae (NG-MAST)" |
| 18 | +LABEL website="https://github.com/MDU-PHL/ngmaster" |
| 19 | +LABEL license="https://github.com/MDU-PHL/ngmaster/blob/master/LICENSE" |
| 20 | +LABEL maintainer="Curtis kapsak" |
| 21 | +LABEL maintainer.email="curtis.kapsak@theiagen.com" |
| 22 | + |
| 23 | +# Install dependencies via apt-get; procps to get the 'ps' command for nextflow compatibility |
| 24 | +# cleanup apt garbage |
| 25 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 26 | + procps && \ |
| 27 | + apt-get autoclean && rm -rf /var/lib/apt/lists/* |
| 28 | + |
| 29 | +# install python, pip, biopython, isPcr version 33 into base micromamba env |
| 30 | +# cleanup conda garbage |
| 31 | +RUN micromamba install -n base -c conda-forge -c bioconda -c defaults \ |
| 32 | + 'python>=3.7' \ |
| 33 | + pip \ |
| 34 | + biopython \ |
| 35 | + any2fasta=${ANY2FASTA_VER} \ |
| 36 | + mlst=${MLST_VER} \ |
| 37 | + ngmaster=${NGMASTER_VER} && \ |
| 38 | + micromamba clean -a -y |
| 39 | + |
| 40 | +# so that mamba/conda env is active when running below commands |
| 41 | +ENV ENV_NAME="base" |
| 42 | +ARG MAMBA_DOCKERFILE_ACTIVATE=1 |
| 43 | + |
| 44 | +# hardcode conda env into the PATH; set locale settings |
| 45 | +ENV PATH="/opt/conda/bin:${PATH}" \ |
| 46 | + LC_ALL=C.UTF-8 |
| 47 | + |
| 48 | +# set final & default working dir to /data |
| 49 | +WORKDIR /data |
| 50 | + |
| 51 | +# test layer |
| 52 | +FROM app AS test |
| 53 | + |
| 54 | +# so that mamba/conda env is active when running below commands |
| 55 | +ENV ENV_NAME="base" |
| 56 | +ARG MAMBA_DOCKERFILE_ACTIVATE=1 |
| 57 | + |
| 58 | +# show help and version outputs; run the program's internal tests |
| 59 | +RUN ngmaster --help && echo && \ |
| 60 | + ngmaster --version && mlst --version && echo && \ |
| 61 | + ngmaster --test |
| 62 | + |
| 63 | +# getting unzip for unziping archive downloaded from NCBI |
| 64 | +RUN apt-get update && apt-get install unzip curl ca-certificates -y --no-install-recommends |
| 65 | + |
| 66 | +# so that testing outputs are in /test |
| 67 | +WORKDIR /test |
| 68 | + |
| 69 | +# test with an actual assembly downloaded from RefSeq |
| 70 | +# more info on this genome here: https://www.ncbi.nlm.nih.gov/labs/data-hub/genome/GCF_013030075.1/ |
| 71 | +RUN curl -OJX GET "https://api.ncbi.nlm.nih.gov/datasets/v2alpha/genome/accession/GCF_013030075.1/download?include_annotation_type=GENOME_FASTA,GENOME_GFF,RNA_FASTA,CDS_FASTA,PROT_FASTA,SEQUENCE_REPORT&filename=GCF_013030075.1.zip" \ |
| 72 | + -H "Accept: application/zip" && \ |
| 73 | + unzip GCF_013030075.1.zip && \ |
| 74 | + ngmaster /test/ncbi_dataset/data/GCF_013030075.1/GCF_013030075.1_ASM1303007v1_genomic.fna > ngmaster.out.tsv && \ |
| 75 | + cat /test/ngmaster.out.tsv |
0 commit comments