diff --git a/.github/workflows/linux-cpp.yml b/.github/workflows/linux-cpp.yml index 82a5a27..e0b2933 100644 --- a/.github/workflows/linux-cpp.yml +++ b/.github/workflows/linux-cpp.yml @@ -29,3 +29,20 @@ jobs: ./* test/* retention-days: 14 + + build-docker: + + runs-on: ubuntu-latest + + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build to test + uses: docker/build-push-action@v5 + with: + push: false + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..762f28c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +FROM ubuntu:jammy + +LABEL base.image="ubuntu:jammy" +LABEL software="stxtyper" +LABEL description="Scan contig files against PubMLST typing schemes" +LABEL website="https://github.com/evolarjun/stxtyper" +LABEL license="https://github.com/evolarjun/stxtyper/blob/main/LICENSE" +LABEL maintainer="Curtis Kapsak" +LABEL maintainer.email="kapsakcj@gmail.com" + +# install dependencies via apt; cleanup apt garbage +# blast from ubuntu:jammy is v2.12.0 (as of 2024-03-26) +# procps is for ps command (required for nextflow) +RUN apt-get update && apt-get install -y --no-install-recommends \ + wget \ + ca-certificates \ + make \ + g++ \ + ncbi-blast+ \ + procps && \ + apt-get autoclean && rm -rf /var/lib/apt/lists/* + +# bring in stxtyper code +COPY . /stxtyper + +# compile +# run test script +# TODO in future: move executables to /usr/local/bin and delete source code (for smaller image) +RUN cd /stxtyper && \ + make && \ + bash test_stxtyper.sh && \ + tblastn -help && \ + ./stxtyper --help + +# set PATH to include where stxtyper & fasta_check executables exist +ENV PATH="${PATH}:/stxtyper" + +# set final working directory as /data for passing data in/out of container +WORKDIR /data diff --git a/README.md b/README.md index 00600d5..8b4cad1 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,24 @@ If you install BLAST via conda in this way you will need to run `conda activate make make test +## Docker + +Pre-built docker images are available on [Dockerhub](https://hub.docker.com/r/kapsakcj/stxtyper), though they may not be as up-to-date as the source code. To pull the image from Dockerhub, run: + +```bash +# Pull the latest image +docker pull kapsakcj/stxtyper:latest + +# Optionally, pull from a specific commit hash +docker pull kapsakcj/stxtyper: +``` + +A Dockerfile is included in the repository. To build the Docker image locally, run this command when in the root directory of the repository: + +```bash +docker build -t stxtyper . +``` + # Usage stxtyper -n []