|
| 1 | +ARG SYLPH_VER="0.9.0" |
| 2 | + |
| 3 | +## Builder ## |
| 4 | +FROM rust:1.90 AS builder |
| 5 | + |
| 6 | +ARG SYLPH_VER |
| 7 | + |
| 8 | +RUN apt update && \ |
| 9 | + apt install -y cmake && \ |
| 10 | + wget -q https://github.com/bluenote-1577/sylph/archive/refs/tags/v${SYLPH_VER}.tar.gz && \ |
| 11 | + tar -xvf v${SYLPH_VER}.tar.gz && \ |
| 12 | + cd sylph-${SYLPH_VER} && \ |
| 13 | + cargo install --path . --root ~/.cargo && \ |
| 14 | + chmod +x /root/.cargo/bin/sylph |
| 15 | + |
| 16 | +## App ## |
| 17 | +FROM ubuntu:jammy AS app |
| 18 | + |
| 19 | +ARG SYLPH_VER |
| 20 | + |
| 21 | +LABEL base.image="ubuntu:jammy" |
| 22 | +LABEL dockerfile.version="1" |
| 23 | +LABEL software="sylph" |
| 24 | +LABEL software.version=${SYLPH_VER} |
| 25 | +LABEL description="sylph is a program that can perform ultrafast (1) ANI querying or (2) metagenomic profiling for metagenomic shotgun samples." |
| 26 | +LABEL website="https://github.com/bluenote-1577/sylph" |
| 27 | +LABEL license="https://github.com/bluenote-1577/sylph/blob/main/LICENSE" |
| 28 | +LABEL maintainer="Stephen Turner" |
| 29 | +LABEL maintainer.email="vustephen@gmail.com" |
| 30 | + |
| 31 | +# copy app from builder stage |
| 32 | +COPY --from=builder /root/.cargo/bin/sylph /usr/local/bin/sylph |
| 33 | + |
| 34 | +# default run command |
| 35 | +CMD ["sylph", "-h"] |
| 36 | + |
| 37 | +# singularity compatibility |
| 38 | +ENV LC_ALL=C |
| 39 | + |
| 40 | +# final working directory in app layer is /data |
| 41 | +WORKDIR /data |
| 42 | + |
| 43 | +## Test ## |
| 44 | +FROM app AS test |
| 45 | + |
| 46 | +# making sure sylph is in PATH |
| 47 | +RUN sylph -h |
| 48 | + |
| 49 | +ARG SYLPH_VER |
| 50 | + |
| 51 | +RUN apt update && apt install -y wget |
| 52 | + |
| 53 | +WORKDIR /test |
| 54 | + |
| 55 | +COPY --from=builder /sylph-${SYLPH_VER}/test_files/* /test |
| 56 | + |
| 57 | +RUN date && \ |
| 58 | + sylph sketch -i e.coli-*.fasta.gz -o database && \ |
| 59 | + sylph sketch o157_reads.fastq.gz && \ |
| 60 | + sylph query database.syldb *.sylsp > ani_queries.tsv && \ |
| 61 | + sylph profile database.syldb *.sylsp > profiling.tsv && \ |
| 62 | + cat *.tsv && \ |
| 63 | + date |
0 commit comments