Standardized packaging for software, dependencies as well as the operating system
Docker lets you create and run applications securely isolated in containers
Docker in life science
Docker can also be used to define software environments and settings for benchmarking studies:
CAMI Challenge: an independent evaluation of several tools in the field of metagenomics.
[…] We defined standards for submitting the software itself, along with parameter settings and required databases and implemented them in Docker container templates … 1
Docker in life science
Docker can also be used to define software environments and settings for benchmarking studies:
For reproducibility, participants could submit a Docker container containing the complete workflow, a Bioconda script or a software repository with detailed installation instructions […] 1
Docker nomenclature
A Docker image is a stand-alone executable package of software
A Docker container is an instance of a Docker image
A Dockerfile is a recipe used to build a Docker image
Docker Hub is an online service for hosting Docker images
An example: using a different OS
Check OS on local machine
$ uname -aDarwin johnsmbp.local 19.6.0 Darwin Kernel Version 19.6.0: [...] x86_64
Pull Ubuntu (Linux) image
$ docker pull ubuntu:16.0416.04: Pulling from library/ubuntu22dc81ace0ea: Pull complete...Digest: sha256:e348fbbea0e0a0e73ab0370de151e7800684445c509d46195aef73e090a49bd6Status: Downloaded image for ubuntu:16.04
An example: using a different OS
Check OS on local machine
$ uname -aDarwin johnsmbp.local 19.6.0 Darwin Kernel Version 19.6.0: [...] x86_64
Run the container interactively and check OS version
To package your code together with the environment it needs
To package a whole project with environment, code and data
Alternatives (2) and (3) are generally not advisable; containers are best used to control the environment for maximal reproducibility, portability and ease-of-use.
The best overall solution is a Git repository storing documentation, code, environment specification as well as instructions on how to get the raw data.
What is Apptainer?
Another software for working with containers, similar to Docker
An apptainer image is contained in a single file, facilitating portability
Does not require root access, making it suitable for work at HPCs
What is Apptainer?
Apptainer used to be ‘Singularity’.
In 2021 Singularity joined the Linux Foundation and became Apptainer.
The company Sylabs still maintains Singularity as a commercial piece of software.
SingularityCE is an Open Source project supported by Sylabs.
The three versions are similar today, but will diverge with time.
Apptainer is the most commonly adopted version of the scientific community.
Docker vs. Apptainer
Runs as a daemon process with superuser privileges
Runs as a regular user
Images stored centrally
Image files that you can move around.
Isolates the host and container file system by default