Skip to content

Commit

Permalink
Merge pull request #2 from kapsakcj/add-docker
Browse files Browse the repository at this point in the history
added Dockerfile and updated main README.md
  • Loading branch information
evolarjun authored Aug 7, 2024
2 parents 33d4c2f + 8e4ca79 commit 4dc572d
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/linux-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:<commit_hash>
```

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 <assembled_nucleotide.fa> [<options>]
Expand Down

0 comments on commit 4dc572d

Please sign in to comment.