From 47792b20c28cd6aacc31386cf0923e8760783011 Mon Sep 17 00:00:00 2001 From: Young Date: Mon, 5 Dec 2022 11:49:34 -0700 Subject: [PATCH 01/31] dockerfile template --- dockerfile-template/version/Dockerfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 dockerfile-template/version/Dockerfile diff --git a/dockerfile-template/version/Dockerfile b/dockerfile-template/version/Dockerfile new file mode 100644 index 000000000..1afe76f30 --- /dev/null +++ b/dockerfile-template/version/Dockerfile @@ -0,0 +1 @@ +Dockerfile template From d75b3800a0af160b078f6dc4faf103e8e4b502e9 Mon Sep 17 00:00:00 2001 From: Young Date: Mon, 5 Dec 2022 11:49:59 -0700 Subject: [PATCH 02/31] Create Dockerfile_mamba --- dockerfile-template/version/Dockerfile_mamba | 1 + 1 file changed, 1 insertion(+) create mode 100644 dockerfile-template/version/Dockerfile_mamba diff --git a/dockerfile-template/version/Dockerfile_mamba b/dockerfile-template/version/Dockerfile_mamba new file mode 100644 index 000000000..5b8aef70f --- /dev/null +++ b/dockerfile-template/version/Dockerfile_mamba @@ -0,0 +1 @@ +dockerfile From 16607d09f2553cff24425e98b7483ba6bfd77cd8 Mon Sep 17 00:00:00 2001 From: Young Date: Mon, 5 Dec 2022 12:20:31 -0700 Subject: [PATCH 03/31] Create README.md --- dockerfile-template/version/README.md | 62 +++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 dockerfile-template/version/README.md diff --git a/dockerfile-template/version/README.md b/dockerfile-template/version/README.md new file mode 100644 index 000000000..a8ae0b076 --- /dev/null +++ b/dockerfile-template/version/README.md @@ -0,0 +1,62 @@ + + +# container + +Main tool: [](link to program) + +Github repository: + +Additional tools: +- list: version + +Basic information on how to use this tool: +- executable: +- help: <-h> +- version: <-v> +- description: + +Additional information: + + + +Full documentation: link to documentation or wiki + +## Example Usage + +```bash + +``` + + + From c2b4f19486d9d48ec7b64f9b146c30b770b338ec Mon Sep 17 00:00:00 2001 From: Young Date: Mon, 5 Dec 2022 12:21:33 -0700 Subject: [PATCH 04/31] Delete Dockerfile --- dockerfile-template/version/Dockerfile | 1 - 1 file changed, 1 deletion(-) delete mode 100644 dockerfile-template/version/Dockerfile diff --git a/dockerfile-template/version/Dockerfile b/dockerfile-template/version/Dockerfile deleted file mode 100644 index 1afe76f30..000000000 --- a/dockerfile-template/version/Dockerfile +++ /dev/null @@ -1 +0,0 @@ -Dockerfile template From db05514d596121db437033ae09727d26b69d0517 Mon Sep 17 00:00:00 2001 From: Young Date: Mon, 5 Dec 2022 12:40:31 -0700 Subject: [PATCH 05/31] Update and rename dockerfile-template/Dockerfile to dockerfile-template/version/Dockerfile --- dockerfile-template/Dockerfile | 60 ---------------------- dockerfile-template/version/Dockerfile | 71 ++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 60 deletions(-) delete mode 100644 dockerfile-template/Dockerfile create mode 100644 dockerfile-template/version/Dockerfile diff --git a/dockerfile-template/Dockerfile b/dockerfile-template/Dockerfile deleted file mode 100644 index aa8a73c4d..000000000 --- a/dockerfile-template/Dockerfile +++ /dev/null @@ -1,60 +0,0 @@ -# FROM defines the base docker image. This command has to come first in the file -# The 'as' keyword lets you name the folowing stage. We use `app` for the production image -FROM ubuntu:focal as app - -# ARG sets environment variables during the build stage -ARG SOFTWARENAME_VER="1.0.0" - -# LABEL instructions tag the image with metadata that might be important to the user -# Optional, but highly recommended -LABEL base.image="ubuntu:focal" -LABEL dockerfile.version="1" -LABEL software="SoftwareName" -LABEL software.version=$SOFTWARENAME_VER -LABEL description="This software does X, Y, AND Z!" -LABEL website="https://github.com/StaPH-B/docker-builds" -LABEL license="https://github.com/StaPH-B/docker-builds/blob/master/LICENSE" -LABEL maintainer="FirstName LastName" -LABEL maintainer.email="my.email@email.com" - -# RUN executes code during the build -# Install dependencies via apt-get or yum if using a centos or fedora base -RUN apt-get update && apt-get install -y \ - dependency_a \ - dependency_b \ - dependency_c - -# Install and/or setup more things. Make /data for use as a working dir -# Example: ncbi-blast+ 2.9.0 -RUN wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.9.0/ncbi-blast-2.9.0+-x64-linux.tar.gz && \ - tar -xzf ncbi-blast-2.9.0+-x64-linux.tar.gz && \ - rm ncbi-blast-2.9.0+-x64-linux.tar.gz && \ - mkdir /data - -# ENV instructions set environment variables that persist from the build into the resulting image -# Use for e.g. $PATH and locale settings for compatibility with Singularity -ENV PATH="/ncbi-blast-2.9.0+/bin:$PATH" \ - LC_ALL=C - -# WORKDIR sets working directory -WORKDIR /data - -# A second FROM insruction creates a new stage -# We use `test` for the test image -FROM app as test - -# Demonstrate that the program is successfully installed - -# Option 1: run the program's internal tests, for example with SPAdes: -RUN spades.py --test - -# Option 2: write your own tests in a bash script in the same directory as your Dockerfile: -COPY my_tests.sh . -RUN bash my_tests.sh - -# Option 3: write python unit tests in a tests/ directory in the same directory as your Dockerfile: -RUN apt-get install -y python3 -RUN mkdir tests/ -COPY tests/ tests/ -RUN python3 -m unittest discover -s tests - diff --git a/dockerfile-template/version/Dockerfile b/dockerfile-template/version/Dockerfile new file mode 100644 index 000000000..3a962c0d3 --- /dev/null +++ b/dockerfile-template/version/Dockerfile @@ -0,0 +1,71 @@ +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### The docker image is built to the 'app' stage on dockerhub/quay. ##### +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### + +# 'FROM' defines the base docker image. This command has to come first in the file +# The 'as' keyword lets you name the folowing stage. The production image uses everything to the 'app' stage. +FROM ubuntu:focal as app + +# List all software versions are ARGs near the top of the dockerfile +# 'ARG' sets environment variables during the build stage +ARG SOFTWARENAME_VER="1.0.0" + +# 'LABEL' instructions tag the image with metadata that might be important to the user +LABEL base.image="ubuntu:focal" +LABEL dockerfile.version="1" +LABEL software="SoftwareName" +LABEL software.version=$SOFTWARENAME_VER +LABEL description="This software does X, Y, AND Z!" +LABEL website="https://github.com/StaPH-B/docker-builds" +LABEL license="https://github.com/StaPH-B/docker-builds/blob/master/LICENSE" +LABEL maintainer="FirstName LastName" +LABEL maintainer.email="my.email@email.com" + +# 'RUN' executes code during the build +# Install dependencies via apt-get or yum if using a centos or fedora base +RUN apt-get update && apt-get install -y --no-install-recommends \ + dependency_a \ + dependency_b \ + dependency_c && \ + apt-get autoclean && rm -rf /var/lib/apt/lists/* + +# Install and/or setup more things. Make /data for use as a working dir +# For readability, limit one install per 'RUN' statement. + +# Example: ncbi-blast+ 2.9.0 +RUN wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.9.0/ncbi-blast-2.9.0+-x64-linux.tar.gz && \ + tar -xzf ncbi-blast-2.9.0+-x64-linux.tar.gz && \ + rm ncbi-blast-2.9.0+-x64-linux.tar.gz && \ + mkdir /data + +# 'ENV' instructions set environment variables that persist from the build into the resulting image +# Use for e.g. $PATH and locale settings for compatibility with Singularity +ENV PATH="/ncbi-blast-2.9.0+/bin:$PATH" \ + LC_ALL=C + +# 'WORKDIR' sets working directory +WORKDIR /data + +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### The docker image is built to the 'test' stage before merging. ##### +##### Anything after 'app' will be lost. ##### +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### + +# A second FROM insruction creates a new stage +FROM app as test + +# Demonstrate that the program is successfully installed + +# Run the program's internal tests if available, for example with SPAdes: +RUN spades.py --test + +# Option 1: write your own tests in a bash script in the same directory as your Dockerfile and copy them: +COPY my_tests.sh . +RUN bash my_tests.sh + +# Option 2: write below common usage cases, for example with tb-profiler: +RUN mkdir test_run && \ + cd test_run && \ + wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR166/009/ERR1664619/ERR1664619_1.fastq.gz && \ + wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR166/009/ERR1664619/ERR1664619_2.fastq.gz && \ + tb-profiler profile -1 ERR1664619_1.fastq.gz -2 ERR1664619_2.fastq.gz -t 4 -p ERR1664619 --txt From f37058594194a25fe71891adb5fd8458d478ff8a Mon Sep 17 00:00:00 2001 From: Young Date: Mon, 5 Dec 2022 13:18:19 -0700 Subject: [PATCH 06/31] Update README.md --- README.md | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d6592f0d3..b490f8a13 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,51 @@ # [docker-builds](#) -This repository contains the Dockerfiles and other assorted files necessary for building Docker images for a variety of programs used by members of the StaPH-B (State Public Health Lab Bioinformatics) consortium. The purpose of this repository is to provide a centralized location for Docker images that is easily accessible for users, with clear documentation on how the containers were built and how to use them. +This repository contains the Dockerfiles and other assorted files necessary for building Docker images for a variety of tools used by members of the StaPH-B (State Public Health Lab Bioinformatics) consortium. The purpose of this repository is to provide a centralized location for Docker images that is easily accessible for users, with clear documentation on how the containers were built and how to use them. -If you would like to contribute with a Docker image or improve upon the existing images, please fork the repository, make your changes/additions, and submit a pull request. If you are having an issue with an existing image, please submit an issue. We welcome any and all feedback! +This is a community resource, built and maintined by users from varied backgrounds and expertise levels. As such, we have provided some [templates for contributing to this repository](./dockerfile-template). If **you** would like to add a Docker image or improve upon the existing images, please fork the repository, make your changes/additions, and submit a pull request. If you are having an issue with an existing image, please submit an issue. We welcome any and all feedback! [See more details on how to contribute here](https://staph-b.github.io/docker-builds/contribute/) +The development process of creating a new image is summarized as follows: + +```mermaid +graph TD + A[fork staphb/docker-builds repo]-->B[create tool/version directory] + B-->C[create readme] + B-->D[create dockerfile] + D-->G[create app and test layers] + + + A-->E[add License to Program_Licenses.md] + A-->F[add tool to list in this readme] + E-->H[submit PR] + F-->H + G-->H + C-->H + H-->I{build to test} + I--success-->J[merged and pushed to dockerhub and quay] + I--failure-->H + + + +``` + ## [Docker User Guide](https://staph-b.github.io/docker-builds/) We have also created a user guide that outlines methods and best practices for using and developing docker containers. [Docker User Guide](https://staph-b.github.io/docker-builds/) +### [Templates]() +Several template files are provided. These are intended to be copied and edited by contributors. +1. [dockerfile-template/version/Dockerfile](./dockerfile-template/version/Dockerfile) is the basic template useful for most images +2. [dockerfile-template/version/Dockerfile_mamba](./dockerfile-template/version/Dockerfile_mamba) is a basic template for using the micromamba base +3. [dockerfile-template/version/README.md](./dockerfile-template/version/README.md) is a basic readme file template to assist others in using the image + #### What about Singularity? For many people Docker is not an option, but Singularity is. Most Docker containers are compatible with Singularity and can easily be converted to Singularity format. Please see the User Guide linked above to for instructions on how to download docker images from dockerhub and how to run them using Singularity. We've worked hard to ensure that our containers are compatibile with Singularity, but if you find one that isn't, please leave an issue and let us know! ## Docker image repositories & hosting We host all of our docker images on two different repositories and periodically sync the images between the two: - 1. Dockerhub - https://hub.docker.com/r/staphb/ - 2. Quay.io - https://quay.io/organization/staphb/ + 1. [Dockerhub](https://hub.docker.com/r/staphb/) - https://hub.docker.com/r/staphb/ + 2. [Quay.io](https://quay.io/organization/staphb/) - https://quay.io/organization/staphb/ In November 2020, Docker began to implement pull rate limits for images hosted on dockerhub. This limits the number of `docker pull`'s per time period (e.g. anonymous users allowed 100 pulls per six hours). We applied and were approved for Docker's "Open Source Program," which should have removed the pull rate limits for all `staphb` docker images! 🎉 🥳 If you encounter an error such as `ERROR: toomanyrequests: Too Many Requests.` or `You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limits.` , please let us know by [submitting an issue.](https://github.com/StaPH-B/docker-builds/issues) From cb6161d391a6891acb05c8ed07b4fe5c79841473 Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 6 Dec 2022 11:25:48 -0700 Subject: [PATCH 07/31] Changing location so GH doesn't trigger --- dockerfile-template/{version => }/Dockerfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename dockerfile-template/{version => }/Dockerfile (100%) diff --git a/dockerfile-template/version/Dockerfile b/dockerfile-template/Dockerfile similarity index 100% rename from dockerfile-template/version/Dockerfile rename to dockerfile-template/Dockerfile From 8c2f80f2cedd0c304c7030d1f5fa9523c77ac600 Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 6 Dec 2022 11:26:06 -0700 Subject: [PATCH 08/31] Changing location so GH doesn't trigger --- dockerfile-template/{version => }/Dockerfile_mamba | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename dockerfile-template/{version => }/Dockerfile_mamba (100%) diff --git a/dockerfile-template/version/Dockerfile_mamba b/dockerfile-template/Dockerfile_mamba similarity index 100% rename from dockerfile-template/version/Dockerfile_mamba rename to dockerfile-template/Dockerfile_mamba From 6731909767cf1cdf448ea254241ecfe2a440a1be Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 6 Dec 2022 11:26:24 -0700 Subject: [PATCH 09/31] Changing location so GH doesn't trigger --- dockerfile-template/{version => }/README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename dockerfile-template/{version => }/README.md (100%) diff --git a/dockerfile-template/version/README.md b/dockerfile-template/README.md similarity index 100% rename from dockerfile-template/version/README.md rename to dockerfile-template/README.md From b22a5d2ef8504ff2d9f2d6072b5869732d756134 Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 6 Dec 2022 11:28:07 -0700 Subject: [PATCH 10/31] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b490f8a13..bc5d1f512 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,9 @@ We have also created a user guide that outlines methods and best practices for u ### [Templates]() Several template files are provided. These are intended to be copied and edited by contributors. -1. [dockerfile-template/version/Dockerfile](./dockerfile-template/version/Dockerfile) is the basic template useful for most images -2. [dockerfile-template/version/Dockerfile_mamba](./dockerfile-template/version/Dockerfile_mamba) is a basic template for using the micromamba base -3. [dockerfile-template/version/README.md](./dockerfile-template/version/README.md) is a basic readme file template to assist others in using the image +1. [dockerfile-template/Dockerfile](./dockerfile-template/Dockerfile) is the basic template useful for most images +2. [dockerfile-template/Dockerfile_mamba](./dockerfile-template/Dockerfile_mamba) is a basic template for using the micromamba base +3. [dockerfile-template/README.md](./dockerfile-template/README.md) is a basic readme file template to assist others in using the image #### What about Singularity? For many people Docker is not an option, but Singularity is. Most Docker containers are compatible with Singularity and can easily be converted to Singularity format. Please see the User Guide linked above to for instructions on how to download docker images from dockerhub and how to run them using Singularity. We've worked hard to ensure that our containers are compatibile with Singularity, but if you find one that isn't, please leave an issue and let us know! From 8325838c33d33e3acf45d62f3c6251242c10c9b9 Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 6 Dec 2022 11:30:02 -0700 Subject: [PATCH 11/31] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc5d1f512..a9c665fae 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ graph TD We have also created a user guide that outlines methods and best practices for using and developing docker containers. [Docker User Guide](https://staph-b.github.io/docker-builds/) -### [Templates]() +### Templates Several template files are provided. These are intended to be copied and edited by contributors. 1. [dockerfile-template/Dockerfile](./dockerfile-template/Dockerfile) is the basic template useful for most images 2. [dockerfile-template/Dockerfile_mamba](./dockerfile-template/Dockerfile_mamba) is a basic template for using the micromamba base From e275a80d284b5c4c906d2d175fc4133aa5d15674 Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 6 Dec 2022 13:29:48 -0700 Subject: [PATCH 12/31] Update README.md --- README.md | 64 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 50 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index a9c665fae..96ba41b7c 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,16 @@ This repository contains the Dockerfiles and other assorted files necessary for building Docker images for a variety of tools used by members of the StaPH-B (State Public Health Lab Bioinformatics) consortium. The purpose of this repository is to provide a centralized location for Docker images that is easily accessible for users, with clear documentation on how the containers were built and how to use them. This is a community resource, built and maintined by users from varied backgrounds and expertise levels. As such, we have provided some [templates for contributing to this repository](./dockerfile-template). If **you** would like to add a Docker image or improve upon the existing images, please fork the repository, make your changes/additions, and submit a pull request. If you are having an issue with an existing image, please submit an issue. We welcome any and all feedback! + + [See more details on how to contribute here](https://staph-b.github.io/docker-builds/contribute/) +## Docker image repositories & hosting +We host all of our docker images on two different repositories: + + 1. [Dockerhub](https://hub.docker.com/r/staphb/) - https://hub.docker.com/r/staphb/ + 2. [Quay.io](https://quay.io/organization/staphb/) - https://quay.io/organization/staphb/ + The development process of creating a new image is summarized as follows: ```mermaid @@ -12,8 +20,6 @@ graph TD B-->C[create readme] B-->D[create dockerfile] D-->G[create app and test layers] - - A-->E[add License to Program_Licenses.md] A-->F[add tool to list in this readme] E-->H[submit PR] @@ -22,15 +28,35 @@ graph TD C-->H H-->I{build to test} I--success-->J[merged and pushed to dockerhub and quay] - I--failure-->H - - - + I--failure-->K[edit dockerfile] + K-->I ``` ## [Docker User Guide](https://staph-b.github.io/docker-builds/) -We have also created a user guide that outlines methods and best practices for using and developing docker containers. -[Docker User Guide](https://staph-b.github.io/docker-builds/) +The [STaPH-B User Guide](https://staphb.org/docker-builds/) was created to outline methods and best practices for using and developing docker containers. There are chapters for +- [Contributing](https://staphb.org/docker-builds/contribute/) +- [Downloading Docker images](https://staphb.org/docker-builds/get_containers/) +- [Running Docker containers](https://staphb.org/docker-builds/run_containers/) +- [Developing Docker images](https://staphb.org/docker-builds/make_containers/) +- [Useful links](https://staphb.org/docker-builds/useful_links/) + +### Summarized usage guide for docker + +``` +# Building a container to the 'test' layer +docker build --tag tool:test --target test +docker build --tag samtools:test --target test samtools/1.15 + +# Pulling a container from dockerhub (most tools have a 'latest' tag) +docker pull staphb/tool:version +docker pull staphb/shigatyper:2.0.2 + +# Running the container (don't forget to mount your volumes!) +docker run -v :/data tool:version +docker run -v $(pwd)/amrfinder_test_files:/data amrfinder:3.10 amrfinder --nucleotide 2021CK-01854_contigs.fa --threads 20 --name 2021CK-01854 --output /data/2021CK-01854.txt --organism Klebsiella +``` + +Further documentation can be found at [docs.docker.com](https://docs.docker.com/engine/reference/run/) ### Templates Several template files are provided. These are intended to be copied and edited by contributors. @@ -38,14 +64,24 @@ Several template files are provided. These are intended to be copied and edited 2. [dockerfile-template/Dockerfile_mamba](./dockerfile-template/Dockerfile_mamba) is a basic template for using the micromamba base 3. [dockerfile-template/README.md](./dockerfile-template/README.md) is a basic readme file template to assist others in using the image -#### What about Singularity? -For many people Docker is not an option, but Singularity is. Most Docker containers are compatible with Singularity and can easily be converted to Singularity format. Please see the User Guide linked above to for instructions on how to download docker images from dockerhub and how to run them using Singularity. We've worked hard to ensure that our containers are compatibile with Singularity, but if you find one that isn't, please leave an issue and let us know! +### What about Singularity? +For many people Docker is not an option, but Singularity is. Most Docker containers are compatible with Singularity and can easily be converted to Singularity format. Please see the [User Guide](https://staphb.org/docker-builds/) for instructions on how to download docker images from dockerhub and how to run them using Singularity. We've worked hard to ensure that our containers are compatibile with Singularity, but if you find one that isn't, please leave an issue and let us know! -## Docker image repositories & hosting -We host all of our docker images on two different repositories and periodically sync the images between the two: +### Summarized usage guide for singularity - 1. [Dockerhub](https://hub.docker.com/r/staphb/) - https://hub.docker.com/r/staphb/ - 2. [Quay.io](https://quay.io/organization/staphb/) - https://quay.io/organization/staphb/ +``` +# Pulling a container from dockerhub (creates a file) +singularity pull --name docker://staphb/bbtools:38.96 +singularity pull --name staphb-bbtools-38.96.simg docker://staphb/bbtools:38.96 + +# Running the container (don't forget to mount your volumes!) +singularity exec --bind :/data +singularity exec --bind $(pwd)/fastq:/data staphb-bbtools-38.96.simg bbduk.sh in1=sample1_R1.fastq.gz in2=sample1_R2.fastq.gz out1=bbduk/sample1_rmphix_R1.fastq.gz out2=bbduk/sample1_rmphix_R2.fastq.gz outm=bbduk/sample1.matched_phix.fq ref=/opt/bbmap/resources/phix174_ill.ref.fa.gz stats=bbduk/sample1.phix.stats.txt threads=4 +``` + +Further documentation can be found at [docs.sylabs.io](https://docs.sylabs.io/guides/3.1/user-guide/cli.html) + +## Logs In November 2020, Docker began to implement pull rate limits for images hosted on dockerhub. This limits the number of `docker pull`'s per time period (e.g. anonymous users allowed 100 pulls per six hours). We applied and were approved for Docker's "Open Source Program," which should have removed the pull rate limits for all `staphb` docker images! 🎉 🥳 If you encounter an error such as `ERROR: toomanyrequests: Too Many Requests.` or `You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limits.` , please let us know by [submitting an issue.](https://github.com/StaPH-B/docker-builds/issues) From 7021d8b7e8e116b557085f995b0e87e4ee0bf268 Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 6 Dec 2022 14:29:09 -0700 Subject: [PATCH 13/31] Update README.md --- dockerfile-template/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfile-template/README.md b/dockerfile-template/README.md index a8ae0b076..f02f8efd9 100644 --- a/dockerfile-template/README.md +++ b/dockerfile-template/README.md @@ -9,7 +9,7 @@ Please edit this readme with some basic information about the tool and how to us Main tool: [](link to program) -Github repository: +Code repository: Additional tools: - list: version @@ -38,7 +38,7 @@ Full documentation: link to documentation or wiki Main tool: [pasty](https://github.com/rpetit3/pasty) -Github repository: https://github.com/rpetit3/pasty +Code repository: https://github.com/rpetit3/pasty Additional tools: - ncbi-blast+: 2.12.0 From 6f5baab612545d05350c8d029684bd822befe05b Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 6 Dec 2022 14:59:37 -0700 Subject: [PATCH 14/31] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 96ba41b7c..d24aea541 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,8 @@ docker pull staphb/tool:version docker pull staphb/shigatyper:2.0.2 # Running the container (don't forget to mount your volumes!) -docker run -v :/data tool:version -docker run -v $(pwd)/amrfinder_test_files:/data amrfinder:3.10 amrfinder --nucleotide 2021CK-01854_contigs.fa --threads 20 --name 2021CK-01854 --output /data/2021CK-01854.txt --organism Klebsiella +docker run --rm -u $(id -u):$(id -g) -v :/data tool:version +docker run --rm -u $(id -u):$(id -g) -v $(pwd)/amrfinder_test_files:/data amrfinder:3.10 amrfinder --nucleotide 2021CK-01854_contigs.fa --threads 20 --name 2021CK-01854 --output /data/2021CK-01854.txt --organism Klebsiella ``` Further documentation can be found at [docs.docker.com](https://docs.docker.com/engine/reference/run/) From 093908cd709b2c6c1fe189cce52cbeed8cc1ebe6 Mon Sep 17 00:00:00 2001 From: kapsakcj Date: Mon, 30 Jan 2023 21:43:50 -0500 Subject: [PATCH 15/31] formatting & small tweaks to main README.md --- README.md | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index d24aea541..95c6d2e72 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,17 @@ -# [docker-builds](#) +# docker-builds + This repository contains the Dockerfiles and other assorted files necessary for building Docker images for a variety of tools used by members of the StaPH-B (State Public Health Lab Bioinformatics) consortium. The purpose of this repository is to provide a centralized location for Docker images that is easily accessible for users, with clear documentation on how the containers were built and how to use them. This is a community resource, built and maintined by users from varied backgrounds and expertise levels. As such, we have provided some [templates for contributing to this repository](./dockerfile-template). If **you** would like to add a Docker image or improve upon the existing images, please fork the repository, make your changes/additions, and submit a pull request. If you are having an issue with an existing image, please submit an issue. We welcome any and all feedback! - [See more details on how to contribute here](https://staph-b.github.io/docker-builds/contribute/) ## Docker image repositories & hosting + We host all of our docker images on two different repositories: - 1. [Dockerhub](https://hub.docker.com/r/staphb/) - https://hub.docker.com/r/staphb/ - 2. [Quay.io](https://quay.io/organization/staphb/) - https://quay.io/organization/staphb/ + 1. [Dockerhub - https://hub.docker.com/r/staphb/](https://hub.docker.com/r/staphb/) + 2. [Quay.io - https://quay.io/organization/staphb/](https://quay.io/organization/staphb/) The development process of creating a new image is summarized as follows: @@ -27,13 +28,15 @@ graph TD G-->H C-->H H-->I{build to test} - I--success-->J[merged and pushed to dockerhub and quay] + I--success-->J[PR merged and pushed to dockerhub and quay] I--failure-->K[edit dockerfile] K-->I ``` -## [Docker User Guide](https://staph-b.github.io/docker-builds/) -The [STaPH-B User Guide](https://staphb.org/docker-builds/) was created to outline methods and best practices for using and developing docker containers. There are chapters for +## User Guide + +The [StaPH-B Docker User Guide](https://staphb.org/docker-builds/) was created to outline methods and best practices for using and developing docker containers. There are chapters for: + - [Contributing](https://staphb.org/docker-builds/contribute/) - [Downloading Docker images](https://staphb.org/docker-builds/get_containers/) - [Running Docker containers](https://staphb.org/docker-builds/run_containers/) @@ -42,16 +45,16 @@ The [STaPH-B User Guide](https://staphb.org/docker-builds/) was created to outli ### Summarized usage guide for docker -``` -# Building a container to the 'test' layer +```bash +# Build a docker image to the 'test' layer docker build --tag tool:test --target test docker build --tag samtools:test --target test samtools/1.15 -# Pulling a container from dockerhub (most tools have a 'latest' tag) +# Download a docker image from dockerhub (most tools have a 'latest' tag) docker pull staphb/tool:version docker pull staphb/shigatyper:2.0.2 -# Running the container (don't forget to mount your volumes!) +# Run the container (don't forget to mount your volumes!) docker run --rm -u $(id -u):$(id -g) -v :/data tool:version docker run --rm -u $(id -u):$(id -g) -v $(pwd)/amrfinder_test_files:/data amrfinder:3.10 amrfinder --nucleotide 2021CK-01854_contigs.fa --threads 20 --name 2021CK-01854 --output /data/2021CK-01854.txt --organism Klebsiella ``` @@ -59,17 +62,20 @@ docker run --rm -u $(id -u):$(id -g) -v $(pwd)/amrfinder_test_files:/data amrfin Further documentation can be found at [docs.docker.com](https://docs.docker.com/engine/reference/run/) ### Templates + Several template files are provided. These are intended to be copied and edited by contributors. + 1. [dockerfile-template/Dockerfile](./dockerfile-template/Dockerfile) is the basic template useful for most images -2. [dockerfile-template/Dockerfile_mamba](./dockerfile-template/Dockerfile_mamba) is a basic template for using the micromamba base +2. [dockerfile-template/Dockerfile_mamba](./dockerfile-template/Dockerfile_mamba) is a basic template for using the micromamba base image 3. [dockerfile-template/README.md](./dockerfile-template/README.md) is a basic readme file template to assist others in using the image ### What about Singularity? + For many people Docker is not an option, but Singularity is. Most Docker containers are compatible with Singularity and can easily be converted to Singularity format. Please see the [User Guide](https://staphb.org/docker-builds/) for instructions on how to download docker images from dockerhub and how to run them using Singularity. We've worked hard to ensure that our containers are compatibile with Singularity, but if you find one that isn't, please leave an issue and let us know! ### Summarized usage guide for singularity -``` +```bash # Pulling a container from dockerhub (creates a file) singularity pull --name docker://staphb/bbtools:38.96 singularity pull --name staphb-bbtools-38.96.simg docker://staphb/bbtools:38.96 From 0abc5056bc477796c93340ccc7b93b77e95fe8ed Mon Sep 17 00:00:00 2001 From: kapsakcj Date: Mon, 30 Jan 2023 21:59:54 -0500 Subject: [PATCH 16/31] slight tweaks to dockerfile template (ubuntu base). Added template micromamba based dockerfile --- dockerfile-template/Dockerfile | 11 ++-- dockerfile-template/Dockerfile_mamba | 88 +++++++++++++++++++++++++++- 2 files changed, 94 insertions(+), 5 deletions(-) diff --git a/dockerfile-template/Dockerfile b/dockerfile-template/Dockerfile index 3a962c0d3..794987786 100644 --- a/dockerfile-template/Dockerfile +++ b/dockerfile-template/Dockerfile @@ -8,13 +8,14 @@ FROM ubuntu:focal as app # List all software versions are ARGs near the top of the dockerfile # 'ARG' sets environment variables during the build stage +# ARG variables are ONLY available during image build, they do not persist in the final image ARG SOFTWARENAME_VER="1.0.0" # 'LABEL' instructions tag the image with metadata that might be important to the user LABEL base.image="ubuntu:focal" LABEL dockerfile.version="1" LABEL software="SoftwareName" -LABEL software.version=$SOFTWARENAME_VER +LABEL software.version="${SOFTWARENAME_VER}" LABEL description="This software does X, Y, AND Z!" LABEL website="https://github.com/StaPH-B/docker-builds" LABEL license="https://github.com/StaPH-B/docker-builds/blob/master/LICENSE" @@ -32,7 +33,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Install and/or setup more things. Make /data for use as a working dir # For readability, limit one install per 'RUN' statement. -# Example: ncbi-blast+ 2.9.0 +# Example: install ncbi-blast+ 2.9.0 pre-compiled linux binaries RUN wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.9.0/ncbi-blast-2.9.0+-x64-linux.tar.gz && \ tar -xzf ncbi-blast-2.9.0+-x64-linux.tar.gz && \ rm ncbi-blast-2.9.0+-x64-linux.tar.gz && \ @@ -54,6 +55,9 @@ WORKDIR /data # A second FROM insruction creates a new stage FROM app as test +# set working directory so that all test inputs & outputs are kept in /test +WORKDIR /test + # Demonstrate that the program is successfully installed # Run the program's internal tests if available, for example with SPAdes: @@ -64,8 +68,7 @@ COPY my_tests.sh . RUN bash my_tests.sh # Option 2: write below common usage cases, for example with tb-profiler: -RUN mkdir test_run && \ - cd test_run && \ +RUN wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR166/009/ERR1664619/ERR1664619_1.fastq.gz && \ wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR166/009/ERR1664619/ERR1664619_2.fastq.gz && \ tb-profiler profile -1 ERR1664619_1.fastq.gz -2 ERR1664619_2.fastq.gz -t 4 -p ERR1664619 --txt diff --git a/dockerfile-template/Dockerfile_mamba b/dockerfile-template/Dockerfile_mamba index 5b8aef70f..5a3356ee8 100644 --- a/dockerfile-template/Dockerfile_mamba +++ b/dockerfile-template/Dockerfile_mamba @@ -1 +1,87 @@ -dockerfile +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### The docker image is built to the 'app' stage on dockerhub/quay. ##### +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### + +# 'FROM' defines the base docker image. This command has to come first in the file +# The 'as' keyword lets you name the folowing stage. The production image uses everything to the 'app' stage. +FROM mambaorg/micromamba:1.2.0 as app + +# List all software versions are ARGs near the top of the dockerfile +# 'ARG' sets environment variables during the build stage +# ARG variables are ONLY available during image build, they do not persist in the final image +ARG SOFTWARENAME_VERSION="1.0.4" + +# build and run as root users since micromamba image has 'mambauser' set as the $USER +USER root +# set workdir to default for building; set to /data at the end +WORKDIR / + +# 'LABEL' instructions tag the image with metadata that might be important to the user + +LABEL base.image="mambaorg/micromamba:1.2.0" +LABEL dockerfile.version="1" +LABEL software="SOFTWARENAME" +LABEL software.version="${SOFTWARENAME_VERSION}" +LABEL description="This software does X, Y, AND Z!" +LABEL website="https://github.com/StaPH-B/docker-builds" +LABEL license="https://github.com/StaPH-B/docker-builds/blob/master/LICENSE" +LABEL maintainer="FirstName LastName" +LABEL maintainer.email="my.email@email.com" + +# 'RUN' executes code during the build +# Install dependencies via apt-get or yum if using a centos or fedora base +RUN apt-get update && apt-get install -y --no-install-recommends \ + wget \ + ca-certificates \ + procps && \ + apt-get autoclean && rm -rf /var/lib/apt/lists/* + +# Install your desired software into the base conda/micromamba environment, pinning the version +# clean up conda garbage +# make /data to use as a working directory +RUN micromamba install --name base -c conda-forge -c bioconda -c defaults SOFTWARENAME=${SOFTWARENAME_VERSION} && \ + micromamba clean -a -y && \ + mkdir /data + +# 'ENV' instructions set environment variables that persist from the build into the resulting image +# set the environment, add base conda/micromamba bin directory into path +# set locale settings to UTF-8 +ENV PATH="/opt/conda/bin/:\ +${PATH}" \ + LC_ALL=C.UTF-8 + +# set final working directory to /data +WORKDIR /data + +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### The docker image is built to the 'test' stage before merging. ##### +##### Anything after 'app' will be lost. ##### +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### + +# A second FROM insruction creates a new stage +# new base for testing +FROM app as test + +# so that conda/micromamba env is active when running below commands +ENV ENV_NAME="base" +ARG MAMBA_DOCKERFILE_ACTIVATE=1 + +# set working directory so that all test inputs & outputs are kept in /test +WORKDIR /test + +# Run the program's internal tests if available, for example with SPAdes: +RUN spades.py --test + +# Option 1: write your own tests in a bash script in the same directory as your Dockerfile and copy them: +COPY my_tests.sh . +RUN bash my_tests.sh + +# Option 2: write below common usage cases, for example with tb-profiler: +RUN wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR166/009/ERR1664619/ERR1664619_1.fastq.gz && \ + wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR166/009/ERR1664619/ERR1664619_2.fastq.gz && \ + tb-profiler profile -1 ERR1664619_1.fastq.gz -2 ERR1664619_2.fastq.gz -t 4 -p ERR1664619 --txt + +# print help and version info; check dependencies (not all software has these options available) +RUN softwarename --help && \ + softwarename --check && \ + softwarename --version \ No newline at end of file From 247f9c1a782d4ba467d3f520dc99354033f72e43 Mon Sep 17 00:00:00 2001 From: kapsakcj Date: Mon, 30 Jan 2023 22:04:42 -0500 Subject: [PATCH 17/31] clarity on main README.md mermaid diagram and fixed dockerfile template --- README.md | 2 +- dockerfile-template/Dockerfile | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 95c6d2e72..5c7bb1a1d 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ graph TD G-->H C-->H H-->I{build to test} - I--success-->J[PR merged and pushed to dockerhub and quay] + I--success-->J[PR merged and docker image pushed to dockerhub and quay] I--failure-->K[edit dockerfile] K-->I ``` diff --git a/dockerfile-template/Dockerfile b/dockerfile-template/Dockerfile index 794987786..eb6030cc8 100644 --- a/dockerfile-template/Dockerfile +++ b/dockerfile-template/Dockerfile @@ -68,7 +68,6 @@ COPY my_tests.sh . RUN bash my_tests.sh # Option 2: write below common usage cases, for example with tb-profiler: -RUN - wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR166/009/ERR1664619/ERR1664619_1.fastq.gz && \ +RUN wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR166/009/ERR1664619/ERR1664619_1.fastq.gz && \ wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR166/009/ERR1664619/ERR1664619_2.fastq.gz && \ tb-profiler profile -1 ERR1664619_1.fastq.gz -2 ERR1664619_2.fastq.gz -t 4 -p ERR1664619 --txt From 53d8d0383ebef566732c6c2d782663ec7d24ab26 Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 18 Jul 2023 10:52:15 -0600 Subject: [PATCH 18/31] Added additional text --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5c7bb1a1d..a639751eb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # docker-builds -This repository contains the Dockerfiles and other assorted files necessary for building Docker images for a variety of tools used by members of the StaPH-B (State Public Health Lab Bioinformatics) consortium. The purpose of this repository is to provide a centralized location for Docker images that is easily accessible for users, with clear documentation on how the containers were built and how to use them. +There are several community projects that create and share containers for bioinformatic tools. This repository contains the Dockerfiles and other assorted files necessary for building Docker images for a variety of tools used by members of the StaPH-B (State Public Health Lab Bioinformatics) consortium. The purpose of this repository is to provide a centralized location for Docker images that is easily accessible for users, with clear documentation on how the containers were built and how to use them. This is a community resource, built and maintined by users from varied backgrounds and expertise levels. As such, we have provided some [templates for contributing to this repository](./dockerfile-template). If **you** would like to add a Docker image or improve upon the existing images, please fork the repository, make your changes/additions, and submit a pull request. If you are having an issue with an existing image, please submit an issue. We welcome any and all feedback! @@ -50,7 +50,7 @@ The [StaPH-B Docker User Guide](https://staphb.org/docker-builds/) was created t docker build --tag tool:test --target test docker build --tag samtools:test --target test samtools/1.15 -# Download a docker image from dockerhub (most tools have a 'latest' tag) +# Download a docker image from dockerhub (most tools have a 'latest' version tag) docker pull staphb/tool:version docker pull staphb/shigatyper:2.0.2 @@ -71,7 +71,7 @@ Several template files are provided. These are intended to be copied and edited ### What about Singularity? -For many people Docker is not an option, but Singularity is. Most Docker containers are compatible with Singularity and can easily be converted to Singularity format. Please see the [User Guide](https://staphb.org/docker-builds/) for instructions on how to download docker images from dockerhub and how to run them using Singularity. We've worked hard to ensure that our containers are compatibile with Singularity, but if you find one that isn't, please leave an issue and let us know! +For many people, Docker is not an option, but Singularity is. Most Docker containers are compatible with Singularity and can easily be converted to Singularity format. Please see the [User Guide](https://staphb.org/docker-builds/) for instructions on how to download docker images from dockerhub and how to run them using Singularity. We've worked hard to ensure that our containers are compatibile with Singularity, but if you find one that isn't, please leave an issue and let us know! ### Summarized usage guide for singularity From 51fc0d673e4af44c4a2117770ab6fc5ef6e2770f Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 18 Jul 2023 11:05:29 -0600 Subject: [PATCH 19/31] Added more text --- dockerfile-template/Dockerfile | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/dockerfile-template/Dockerfile b/dockerfile-template/Dockerfile index eb6030cc8..97430421e 100644 --- a/dockerfile-template/Dockerfile +++ b/dockerfile-template/Dockerfile @@ -1,9 +1,16 @@ ##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### Thank you for using this Dockerfile template! ##### +##### This is an outline for the flow of building a docker image. ##### ##### The docker image is built to the 'app' stage on dockerhub/quay. ##### ##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### -# 'FROM' defines the base docker image. This command has to come first in the file +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### Step 1. Set up the base image in the first stage. ##### +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### + +# 'FROM' defines where the Dockerfile is starting to build from. This command has to come first in the file # The 'as' keyword lets you name the folowing stage. The production image uses everything to the 'app' stage. + FROM ubuntu:focal as app # List all software versions are ARGs near the top of the dockerfile @@ -34,22 +41,28 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # For readability, limit one install per 'RUN' statement. # Example: install ncbi-blast+ 2.9.0 pre-compiled linux binaries -RUN wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.9.0/ncbi-blast-2.9.0+-x64-linux.tar.gz && \ - tar -xzf ncbi-blast-2.9.0+-x64-linux.tar.gz && \ - rm ncbi-blast-2.9.0+-x64-linux.tar.gz && \ +ARG BLAST_VER=2.9.0 + +RUN wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${BLAST_VER}/ncbi-blast-${BLAST_VER}+-x64-linux.tar.gz && \ + tar -xzf ncbi-blast-${BLAST_VER}+-x64-linux.tar.gz && \ + rm ncbi-blast-${BLAST_VER}+-x64-linux.tar.gz && \ mkdir /data # 'ENV' instructions set environment variables that persist from the build into the resulting image # Use for e.g. $PATH and locale settings for compatibility with Singularity -ENV PATH="/ncbi-blast-2.9.0+/bin:$PATH" \ +ENV PATH="/software-${SOFTWARENAME_VER}/bin:$PATH" \ LC_ALL=C +# 'CMD' instructions set a default command when the container is run. This is typically 'tool --help.' +CMD [ "tool", "--help" ] + # 'WORKDIR' sets working directory WORKDIR /data ##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### -##### The docker image is built to the 'test' stage before merging. ##### -##### Anything after 'app' will be lost. ##### +##### Step 2. Set up the testing stage. ##### +##### The docker image is built to the 'test' stage before merging, but ##### +##### the test stage (or any stage after 'app') will be lost. ##### ##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### # A second FROM insruction creates a new stage @@ -58,7 +71,7 @@ FROM app as test # set working directory so that all test inputs & outputs are kept in /test WORKDIR /test -# Demonstrate that the program is successfully installed +# Demonstrate that the program is successfully installed - which is highly dependant on what the tool is. # Run the program's internal tests if available, for example with SPAdes: RUN spades.py --test From 7189e4858c1f0bf932df662e4ee25358287ace94 Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 18 Jul 2023 11:18:27 -0600 Subject: [PATCH 20/31] Update Dockerfile_mamba --- dockerfile-template/Dockerfile_mamba | 48 +++++++++++++++++++++------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/dockerfile-template/Dockerfile_mamba b/dockerfile-template/Dockerfile_mamba index 5a3356ee8..8cbe1233d 100644 --- a/dockerfile-template/Dockerfile_mamba +++ b/dockerfile-template/Dockerfile_mamba @@ -1,14 +1,28 @@ ##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### Thank you for using this Dockerfile template! ##### +##### This is an outline for the flow of building a docker image. ##### ##### The docker image is built to the 'app' stage on dockerhub/quay. ##### ##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### Step 1. Set up the base image in the first stage. ##### +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### + +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### Conda can be a useful packaging manager that handles the ##### +##### installation of tools and their dependencies. Generally, images ##### +##### built via this method are larger, and may have file ownership ##### +##### errors - which is why we generally recommend attempting to build ##### +##### from source first. ##### +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### + # 'FROM' defines the base docker image. This command has to come first in the file # The 'as' keyword lets you name the folowing stage. The production image uses everything to the 'app' stage. -FROM mambaorg/micromamba:1.2.0 as app +FROM mambaorg/micromamba:1.4.9 as app # List all software versions are ARGs near the top of the dockerfile # 'ARG' sets environment variables during the build stage -# ARG variables are ONLY available during image build, they do not persist in the final image +# 'ARG' variables are ONLY available during image build, they do not persist in the final image ARG SOFTWARENAME_VERSION="1.0.4" # build and run as root users since micromamba image has 'mambauser' set as the $USER @@ -18,7 +32,7 @@ WORKDIR / # 'LABEL' instructions tag the image with metadata that might be important to the user -LABEL base.image="mambaorg/micromamba:1.2.0" +LABEL base.image="mambaorg/micromamba:1.4.9" LABEL dockerfile.version="1" LABEL software="SOFTWARENAME" LABEL software.version="${SOFTWARENAME_VERSION}" @@ -30,6 +44,13 @@ LABEL maintainer.email="my.email@email.com" # 'RUN' executes code during the build # Install dependencies via apt-get or yum if using a centos or fedora base +RUN apt-get update && apt-get install -y --no-install-recommends \ + dependency_a \ + dependency_b \ + dependency_c && \ + apt-get autoclean && rm -rf /var/lib/apt/lists/* + +# Example apt-get command for commonly-missing dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ wget \ ca-certificates \ @@ -46,16 +67,19 @@ RUN micromamba install --name base -c conda-forge -c bioconda -c defaults SOFTWA # 'ENV' instructions set environment variables that persist from the build into the resulting image # set the environment, add base conda/micromamba bin directory into path # set locale settings to UTF-8 -ENV PATH="/opt/conda/bin/:\ -${PATH}" \ +ENV PATH="/opt/conda/bin/:${PATH}" \ LC_ALL=C.UTF-8 +# 'CMD' instructions set a default command when the container is run. This is typically 'tool --help.' +CMD [ "tool", "--help" ] + # set final working directory to /data WORKDIR /data ##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### -##### The docker image is built to the 'test' stage before merging. ##### -##### Anything after 'app' will be lost. ##### +##### Step 2. Set up the testing stage. ##### +##### The docker image is built to the 'test' stage before merging, but ##### +##### the test stage (or any stage after 'app') will be lost. ##### ##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### # A second FROM insruction creates a new stage @@ -69,6 +93,12 @@ ARG MAMBA_DOCKERFILE_ACTIVATE=1 # set working directory so that all test inputs & outputs are kept in /test WORKDIR /test +# print help and version info; check dependencies (not all software has these options available) +# Mostly this ensures the tool of choice is in path and is executable +RUN softwarename --help && \ + softwarename --check && \ + softwarename --version + # Run the program's internal tests if available, for example with SPAdes: RUN spades.py --test @@ -81,7 +111,3 @@ RUN wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR166/009/ERR1664619/ERR1664619_1.f wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR166/009/ERR1664619/ERR1664619_2.fastq.gz && \ tb-profiler profile -1 ERR1664619_1.fastq.gz -2 ERR1664619_2.fastq.gz -t 4 -p ERR1664619 --txt -# print help and version info; check dependencies (not all software has these options available) -RUN softwarename --help && \ - softwarename --check && \ - softwarename --version \ No newline at end of file From c4a27ebd4b29745ab7eeb5fcad063d4a2034f815 Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 18 Jul 2023 11:19:29 -0600 Subject: [PATCH 21/31] Update Dockerfile --- dockerfile-template/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dockerfile-template/Dockerfile b/dockerfile-template/Dockerfile index 97430421e..993166f02 100644 --- a/dockerfile-template/Dockerfile +++ b/dockerfile-template/Dockerfile @@ -71,6 +71,12 @@ FROM app as test # set working directory so that all test inputs & outputs are kept in /test WORKDIR /test +# print help and version info; check dependencies (not all software has these options available) +# Mostly this ensures the tool of choice is in path and is executable +RUN softwarename --help && \ + softwarename --check && \ + softwarename --version + # Demonstrate that the program is successfully installed - which is highly dependant on what the tool is. # Run the program's internal tests if available, for example with SPAdes: From 575402e8af700dd4d477c024158f3342dcae78f5 Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 18 Jul 2023 11:21:01 -0600 Subject: [PATCH 22/31] Update README.md --- dockerfile-template/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfile-template/README.md b/dockerfile-template/README.md index f02f8efd9..d205b147b 100644 --- a/dockerfile-template/README.md +++ b/dockerfile-template/README.md @@ -1,7 +1,7 @@ From 809f1b911d8ec1686ca82034307a2567b22bfb27 Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 18 Jul 2023 11:38:51 -0600 Subject: [PATCH 23/31] Create Dockerfile_builder --- dockerfile-template/Dockerfile_builder | 129 +++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 dockerfile-template/Dockerfile_builder diff --git a/dockerfile-template/Dockerfile_builder b/dockerfile-template/Dockerfile_builder new file mode 100644 index 000000000..469ff46a9 --- /dev/null +++ b/dockerfile-template/Dockerfile_builder @@ -0,0 +1,129 @@ +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### Thank you for using this Dockerfile template! ##### +##### This is an outline for the flow of building a docker image. ##### +##### The docker image is built to the 'app' stage on dockerhub/quay. ##### +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### + +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### Sometimes tools required to build a tool are not needed to run ##### +##### it. This means that images are larger than they need to be. A way ##### +##### to reduce the size of an image, is to have a stage prior to 'app' ##### +##### where these temporarily-required tools are installed. Then, only ##### +##### relevant executables and files are copied in to the 'app' stage. ##### +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### + +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### Step 1. Set up the builder stage as the first stage. ##### +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### + +# Please note, all 'LABEL', 'ENV', and 'CMD' instructions will be lost +# Also, files and executables are not carried over unless they are explicitly copied. + +# 'FROM' defines where the Dockerfile is starting to build from. This command has to come first in the file +FROM ubuntu:jammy as builder + +# 'RUN' executes code during the build +# Install dependencies via apt-get or yum if using a centos or fedora base +RUN apt-get update && apt-get install -y --no-install-recommends \ + dependency_a \ + dependency_b \ + dependency_c && \ + apt-get autoclean && rm -rf /var/lib/apt/lists/* + +# Install and/or setup more things. Make /data for use as a working dir +# For readability, limit one install per 'RUN' statement. + +# Example: install ncbi-blast+ 2.9.0 pre-compiled linux binaries +ARG BLAST_VER=2.9.0 + +RUN wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${BLAST_VER}/ncbi-blast-${BLAST_VER}+-x64-linux.tar.gz && \ + tar -xzf ncbi-blast-${BLAST_VER}+-x64-linux.tar.gz && \ + rm ncbi-blast-${BLAST_VER}+-x64-linux.tar.gz + +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### Step 2. Set up the base image in the 'app' stage. ##### +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### + +# 'FROM' defines where the Dockerfile is starting to build from. This command has to come first in the file +# The 'as' keyword lets you name the folowing stage. The production image uses everything to the 'app' stage. + +FROM ubuntu:jammy as app + +# List all software versions are ARGs near the top of the dockerfile +# 'ARG' sets environment variables during the build stage +# ARG variables are ONLY available during image build, they do not persist in the final image +ARG SOFTWARENAME_VER="1.0.0" + +# 'LABEL' instructions tag the image with metadata that might be important to the user +LABEL base.image="ubuntu:jammy" +LABEL dockerfile.version="1" +LABEL software="SoftwareName" +LABEL software.version="${SOFTWARENAME_VER}" +LABEL description="This software does X, Y, AND Z!" +LABEL website="https://github.com/StaPH-B/docker-builds" +LABEL license="https://github.com/StaPH-B/docker-builds/blob/master/LICENSE" +LABEL maintainer="FirstName LastName" +LABEL maintainer.email="my.email@email.com" + +# copy in files and executables into app stage +COPY --from=builder + +# example copy in blast executable +ARG BLAST_VER=2.9.0 +COPY --from=builder /bwa/bwa-${BWA_VER}/bwa /usr/local/bin + +# 'RUN' executes code during the build +# Install dependencies via apt-get or yum if using a centos or fedora base +# Please ensure ALL dependencies for running the tool make it into this stage +RUN apt-get update && apt-get install -y --no-install-recommends \ + dependency_a \ + dependency_b \ + dependency_c && \ + apt-get autoclean && rm -rf /var/lib/apt/lists/* + +# Install and/or setup more things. Make /data for use as a working dir +# For readability, limit one install per 'RUN' statement. + +# 'ENV' instructions set environment variables that persist from the build into the resulting image +# Use for e.g. $PATH and locale settings for compatibility with Singularity +ENV PATH="/software-${SOFTWARENAME_VER}/bin:$PATH" \ + LC_ALL=C + +# 'CMD' instructions set a default command when the container is run. This is typically 'tool --help.' +CMD [ "tool", "--help" ] + +# 'WORKDIR' sets working directory +WORKDIR /data + +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### Step 3. Set up the testing stage. ##### +##### The docker image is built to the 'test' stage before merging, but ##### +##### the test stage (or any stage after 'app') will be lost. ##### +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### + +# A second FROM insruction creates a new stage +# The test stage must be downstream from 'app' +FROM app as test + +# set working directory so that all test inputs & outputs are kept in /test +WORKDIR /test + +# print help and version info; check dependencies (not all software has these options available) +# Mostly this ensures the tool of choice is in path and is executable +RUN softwarename --help && \ + softwarename --check && \ + softwarename --version + +# Demonstrate that the program is successfully installed - which is highly dependant on what the tool is. + +# Run the program's internal tests if available, for example with SPAdes: +RUN spades.py --test + +# Option 1: write your own tests in a bash script in the same directory as your Dockerfile and copy them: +COPY my_tests.sh . +RUN bash my_tests.sh + +# Option 2: write below common usage cases, for example with tb-profiler: +RUN wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR166/009/ERR1664619/ERR1664619_1.fastq.gz && \ + wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR166/009/ERR1664619/ERR1664619_2.fastq.gz && \ + tb-profiler profile -1 ERR1664619_1.fastq.gz -2 ERR1664619_2.fastq.gz -t 4 -p ERR1664619 --txt From 7733c3eceb2c7c0a02c75b7c6b99eb65a06c1762 Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 18 Jul 2023 11:40:18 -0600 Subject: [PATCH 24/31] Update to jammy --- dockerfile-template/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfile-template/Dockerfile b/dockerfile-template/Dockerfile index 993166f02..24064fcdc 100644 --- a/dockerfile-template/Dockerfile +++ b/dockerfile-template/Dockerfile @@ -11,7 +11,7 @@ # 'FROM' defines where the Dockerfile is starting to build from. This command has to come first in the file # The 'as' keyword lets you name the folowing stage. The production image uses everything to the 'app' stage. -FROM ubuntu:focal as app +FROM ubuntu:jammy as app # List all software versions are ARGs near the top of the dockerfile # 'ARG' sets environment variables during the build stage @@ -19,7 +19,7 @@ FROM ubuntu:focal as app ARG SOFTWARENAME_VER="1.0.0" # 'LABEL' instructions tag the image with metadata that might be important to the user -LABEL base.image="ubuntu:focal" +LABEL base.image="ubuntu:jammy" LABEL dockerfile.version="1" LABEL software="SoftwareName" LABEL software.version="${SOFTWARENAME_VER}" From 6249a8c57bffcbd2359cb50e026ab989bf5cd63a Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 18 Jul 2023 11:53:18 -0600 Subject: [PATCH 25/31] Update contribute.md --- docs/contribute.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/contribute.md b/docs/contribute.md index 6227022fa..b320b530a 100644 --- a/docs/contribute.md +++ b/docs/contribute.md @@ -5,18 +5,19 @@ layout: page ## Contributing -So far, we've created a bunch of docker images that we use in our day-to-day activities, but if there is a specific tool you do not see on our list and would like to add your own docker image, we would love to add it to the list. - Discover a bug or having issues with our images? Do you have a suggestion or advice for improving our docker images? [Please submit an issue under the Issues tab on our github repository](https://github.com/StaPH-B/docker-builds/issues) +Regardless of how many docker images are available via staphb/Dockerbuilds or other efforts, there are still tools that are not available in a container. We would welcome your contribution if you do not see a tool on our list and would like to add your own docker image. + ### How to contribute a new Docker image 1. Build your own docker image using a Dockerfile (information on this in [Develop your own container](https://staph-b.github.io/docker-builds/make_containers/)) 2. Fork this github repository using the fork button at the top right hand of the github page. + * There are Dockerfile and README templates that can be copied from https://github.com/StaPH-B/docker-builds/tree/master/dockerfile-template and edited 3. Add your Dockerfile, README, and test files to your forked repository following these conventions: * The first directory should be the name of the program with special characters removed, and it's preferable to remove uppercase - `/spades` * The second directory should be the version number of the program, in X.X.X format - `/spades/3.12.0` * The Dockerfile and any other files required for building and testing belong in the sub-directory - `/spades/3.12.0/Dockerfile` and `/spades/3.12.0/my_spades_tests.sh` - * NOTE: There is a file size limit for github (I believe 100MB/file), so if you have a program with a huge database or file of some kind - we won't be able to store the it in our github repository, and that database should be downloaded as part of the Dockerfile instructions with `wget`, `curl`, etc. + * NOTE: There is a file size limit for github (~100MB/file), so if you have a program with a huge database or file of some kind - we won't be able to store the it in our github repository, and that database should be downloaded as part of the Dockerfile instructions with `wget`, `curl`, etc. 4. Please edit the `README.md` and `LICENSE.md` with the appropriate information for your program (follow alphabetical order please!) and commit changes to your forked repo. It's easiest to copy a line for an existing program from the raw markdown documents [README.md](https://raw.githubusercontent.com/StaPH-B/docker-builds/master/README.md) or [LICENSE.md](https://raw.githubusercontent.com/StaPH-B/docker-builds/master/LICENSE.md) and replace the information with your new image. 5. Open your github actions tab in the forked repository in the GitHub user interface and use the 'Manual Test' with the corresponding tool and version to test. If it passes, the files are ready to submit in a pull request! 6. Visit our docker-builds github repository and a green "Submit Pull Request" button should appear near the top of the page. Click it, and submit a pull request to merge your forked repository into our repository. From acd44c2c63117a4ba81106eaba85f34370cd0293 Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 18 Jul 2023 11:57:48 -0600 Subject: [PATCH 26/31] Update run_containers.md --- docs/run_containers.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/run_containers.md b/docs/run_containers.md index 1bceb743a..149aebf0a 100644 --- a/docs/run_containers.md +++ b/docs/run_containers.md @@ -30,12 +30,15 @@ To run a staphb image you simply name the image you want to use. ``` docker run staphb/trimmomatic ``` -The previous command did not give any instructions to the container so the container simply started and then exited. +The previous command did not give any instructions to the container so the container simply started and then exited. Many images have a 'CMD' instruction that prints the help command for the main tool of the image, but some do not. To see an executed command run the following command. ``` docker run staphb/trimmomatic sh -c "echo Hello from inside the trimmomatic container" ``` + + + There are a number of options you can also supply to the run command. We have found the following command is useful for running containers: ``` docker run --rm=True -v $PWD:/data -u $(id -u):$(id -g) staphb/: <--flags --go --here> @@ -68,6 +71,8 @@ Here is a description of each of the flags we used in the previous command. based on the user and group from the local machine, resulting in the correct file ownership. ``` +By design, containers only interact with the directories given to them. If you cannot see your files in the container or the result files after running something in a container, please check which dictories are mounted with `-v`. + ##### NOTE: This can be incorporated into a bash function by including the following into your .bashrc ``` #docker_run function From 80aa0e37a865089e39c51900e8392d25dd5550db Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 18 Jul 2023 12:03:34 -0600 Subject: [PATCH 27/31] Delete readme-template.md --- .github/workflow-templates/readme-template.md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .github/workflow-templates/readme-template.md diff --git a/.github/workflow-templates/readme-template.md b/.github/workflow-templates/readme-template.md deleted file mode 100644 index 0bc4b0d70..000000000 --- a/.github/workflow-templates/readme-template.md +++ /dev/null @@ -1,16 +0,0 @@ -# container - -Main tool : [](link to program) - -Additional tools: -- list - -Full documentation: link to documentation or wiki - - - -## Example Usage - -```bash - -``` From d86971d095ce41ac73a634b69aed4edcfb226fe3 Mon Sep 17 00:00:00 2001 From: Erin Young Date: Wed, 6 Sep 2023 20:35:10 +0000 Subject: [PATCH 28/31] added python-centric Dockerfile --- dockerfile-template/Dockerfile_python3 | 100 +++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 dockerfile-template/Dockerfile_python3 diff --git a/dockerfile-template/Dockerfile_python3 b/dockerfile-template/Dockerfile_python3 new file mode 100644 index 000000000..9d6411ae5 --- /dev/null +++ b/dockerfile-template/Dockerfile_python3 @@ -0,0 +1,100 @@ +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### Thank you for using this Dockerfile template! ##### +##### This is an outline for the flow of building a docker image. ##### +##### The docker image is built to the 'app' stage on dockerhub/quay. ##### +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### + +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### Pip/pypi can be a useful packaging manager that handles the ##### +##### installation of tools and their dependencies. This template uses ##### +##### a base image for which python3 and pip are already installed, and ##### +##### is intended to be used for tools installed solely via pip (it's ##### +##### like the pypi version of the Dockerfile_mamba template for conda ##### +##### installations.) +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### + +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### Step 1. Set up the base image in the first stage. ##### +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### + +# 'FROM' defines where the Dockerfile is starting to build from. This command has to come first in the file +# The 'as' keyword lets you name the folowing stage. The production image uses everything to the 'app' stage. + +FROM python:3.9.17-slim as app + +# List all software versions are ARGs near the top of the dockerfile +# 'ARG' sets environment variables during the build stage +# ARG variables are ONLY available during image build, they do not persist in the final image +ARG SOFTWARENAME_VER="1.0.0" + +# 'LABEL' instructions tag the image with metadata that might be important to the user +LABEL base.image="python:3.9.17-slim" +LABEL dockerfile.version="1" +LABEL software="SoftwareName" +LABEL software.version="${SOFTWARENAME_VER}" +LABEL description="This software does X, Y, AND Z!" +LABEL website="https://github.com/StaPH-B/docker-builds" +LABEL license="https://github.com/StaPH-B/docker-builds/blob/master/LICENSE" +LABEL maintainer="FirstName LastName" +LABEL maintainer.email="my.email@email.com" + +# 'RUN' executes code during the build +# Install dependencies via apt-get or yum if using a centos or fedora base +RUN apt-get update && apt-get install -y --no-install-recommends \ + dependency_a \ + dependency_b \ + dependency_c && \ + apt-get autoclean && rm -rf /var/lib/apt/lists/* + +# Install and/or setup more things. Make /data for use as a working dir +# For readability, limit one install per 'RUN' statement. +RUN pip install software==${SOFTWARENAME_VER} + + +# Example: install pygenomeviz 0.3.2 +ARG PYGENOMEVIZ_VER="0.3.2" + +RUN pip install pygenomeviz==$PYGENOMEVIZ_VER + +# 'ENV' instructions set environment variables that persist from the build into the resulting image +# Use for e.g. $PATH and locale settings for compatibility with Singularity +ENV PATH="/software-${SOFTWARENAME_VER}/bin:$PATH" \ + LC_ALL=C + +# 'CMD' instructions set a default command when the container is run. This is typically 'tool --help.' +CMD [ "tool", "--help" ] + +# 'WORKDIR' sets working directory +WORKDIR /data + +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### +##### Step 2. Set up the testing stage. ##### +##### The docker image is built to the 'test' stage before merging, but ##### +##### the test stage (or any stage after 'app') will be lost. ##### +##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ##### + +# A second FROM insruction creates a new stage +FROM app as test + +# set working directory so that all test inputs & outputs are kept in /test +WORKDIR /test + +# print help and version info; check dependencies (not all software has these options available) +# Mostly this ensures the tool of choice is in path and is executable +RUN softwarename --help && \ + softwarename --check && \ + softwarename --version + +# Demonstrate that the program is successfully installed - which is highly dependant on what the tool is. + +# Run the program's internal tests if available, for example with SPAdes: +RUN spades.py --test + +# Option 1: write your own tests in a bash script in the same directory as your Dockerfile and copy them: +COPY my_tests.sh . +RUN bash my_tests.sh + +# Option 2: write below common usage cases, for example with tb-profiler: +RUN wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR166/009/ERR1664619/ERR1664619_1.fastq.gz && \ + wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR166/009/ERR1664619/ERR1664619_2.fastq.gz && \ + tb-profiler profile -1 ERR1664619_1.fastq.gz -2 ERR1664619_2.fastq.gz -t 4 -p ERR1664619 --txt From 3cdcbf326afaebdbf7fcbcfbcd8881d95201578d Mon Sep 17 00:00:00 2001 From: Young Date: Thu, 7 Sep 2023 12:06:58 -0600 Subject: [PATCH 29/31] Update Dockerfile_python3 --- dockerfile-template/Dockerfile_python3 | 1 + 1 file changed, 1 insertion(+) diff --git a/dockerfile-template/Dockerfile_python3 b/dockerfile-template/Dockerfile_python3 index 9d6411ae5..228bae38c 100644 --- a/dockerfile-template/Dockerfile_python3 +++ b/dockerfile-template/Dockerfile_python3 @@ -41,6 +41,7 @@ LABEL maintainer.email="my.email@email.com" # 'RUN' executes code during the build # Install dependencies via apt-get or yum if using a centos or fedora base RUN apt-get update && apt-get install -y --no-install-recommends \ + procps \ dependency_a \ dependency_b \ dependency_c && \ From d3f8073a4d056ee5bbe0d7368027866c5fe0e672 Mon Sep 17 00:00:00 2001 From: Young Date: Thu, 7 Sep 2023 13:12:16 -0600 Subject: [PATCH 30/31] Added --no-cache --- dockerfile-template/Dockerfile_python3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfile-template/Dockerfile_python3 b/dockerfile-template/Dockerfile_python3 index 228bae38c..7bdc747cf 100644 --- a/dockerfile-template/Dockerfile_python3 +++ b/dockerfile-template/Dockerfile_python3 @@ -49,13 +49,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Install and/or setup more things. Make /data for use as a working dir # For readability, limit one install per 'RUN' statement. -RUN pip install software==${SOFTWARENAME_VER} +RUN pip install --no-cache software==${SOFTWARENAME_VER} # Example: install pygenomeviz 0.3.2 ARG PYGENOMEVIZ_VER="0.3.2" -RUN pip install pygenomeviz==$PYGENOMEVIZ_VER +RUN pip install --no-cache pygenomeviz==$PYGENOMEVIZ_VER # 'ENV' instructions set environment variables that persist from the build into the resulting image # Use for e.g. $PATH and locale settings for compatibility with Singularity From a7ff51bbf53c45dd48333306123a73c2d2a2ab41 Mon Sep 17 00:00:00 2001 From: Curtis Kapsak Date: Fri, 29 Sep 2023 13:27:05 -0400 Subject: [PATCH 31/31] Update contribute.md typo in the repo name --- docs/contribute.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contribute.md b/docs/contribute.md index b320b530a..2c1ef4be9 100644 --- a/docs/contribute.md +++ b/docs/contribute.md @@ -7,7 +7,7 @@ layout: page ## Contributing Discover a bug or having issues with our images? Do you have a suggestion or advice for improving our docker images? [Please submit an issue under the Issues tab on our github repository](https://github.com/StaPH-B/docker-builds/issues) -Regardless of how many docker images are available via staphb/Dockerbuilds or other efforts, there are still tools that are not available in a container. We would welcome your contribution if you do not see a tool on our list and would like to add your own docker image. +Regardless of how many docker images are available via staphb/docker-builds or other efforts, there are still tools that are not available in a container. We would welcome your contribution if you do not see a tool on our list and would like to add your own docker image. ### How to contribute a new Docker image 1. Build your own docker image using a Dockerfile (information on this in [Develop your own container](https://staph-b.github.io/docker-builds/make_containers/))