Working with containers

23-Oct-2026

What is Docker?

  • 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:


2nd CAMI Challenge

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 -a
Darwin johnsmbp.local 27.0.0 Darwin Kernel Version 27.0.0: [...] arm64

Pull Ubuntu (Linux) image

$ docker pull ubuntu:24.04
24.04: Pulling from library/ubuntu
00dbf11534ae: Pull complete
...
Digest: sha256:68ee22004a9109b44973313b02ff7b1de250f1de0f5ecb628d73f579aaff33ac
Status: Downloaded newer image for ubuntu:24.04

An example: using a different OS

Check OS on local machine

$ uname -a
Darwin johnsmbp.local 27.0.0 Darwin Kernel Version 27.0.0: [...] arm64

Run the container interactively and check OS version

$ docker run -it ubuntu:24.04
root@26aba7b7753c:/# uname -a
Linux 26aba7b7753c 7.0.14-linuxkit [...] aarch64 GNU/Linux

Mounting volumes

Local project/ directory:

$ ls
├── doc/
├── data/
├── code/
├── logs/
├── results/
├── Snakefile
├── config.yml
├── environment.yml
├── Dockerfile
└── README.md

Docker container file system:

$ docker run \
    -v $PWD/data:/home/data \
    ubuntu:24.04 \
    ls

├── bin/
├── dev/
├── etc/
├── home/
│   └── data/
├── lib/
├── sys/
└── usr/

What can I use Docker for?

  1. As an advanced environment manager
  2. To package your code together with the environment it needs
  3. 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 called ‘Singularity’.
  • In 2021 the open-source Singularity project joined the Linux Foundation and became Apptainer.
  • The company Sylabs forked it as SingularityCE (open source) and SingularityPRO (commercial).
  • In October 2026 Sylabs discontinued all its Singularity products; SingularityCE 4.6 is the final release.
  • Apptainer is the actively maintained version, and still provides the singularity command and runs the same SIF images.

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 Containers have access to host file system
Well-supported on Mac, Linux and Windows Limited support on Mac and Windows

Questions?