CBIO7501 · Lesson 08
pixi.lockA container is a way to hand someone the whole working setup, not just the code.
your analysis ← Git (lesson 04)
Python, samtools … ← pixi.lock (lesson 05)
C library, OS tools ← ??? ← a container pins this too
kernel, hardware ← nobody
:0.1.0) can move; digest (@sha256:…) cannotThe container brings its own operating system files; it borrows only the kernel of the computer it runs on (on a Mac, a small Linux virtual machine).
-v "$PWD":/work puts your project folder at /work inside the container; -w /work starts there. Results written to /work land in your project.
| Docker | Apptainer | |
|---|---|---|
| Where | laptops, GitHub Actions | HPC clusters (Linux only) |
| Needs root? | a root service | no |
| Your files | mount with -v "$PWD":/work |
home and current folder mounted automatically |
| Same image? | builds it | converts it: apptainer build x.sif docker://… |
| Images | stored by the Docker service | single .sif files you can copy |
| Isolation | separate file system by default | sees much of the host’s |
| Runs on | Linux, macOS, Windows | Linux (macOS and Windows only in a VM) |
Singularity became Apptainer under the Linux Foundation in 2021. Sylabs’ fork, SingularityCE, released 4.6.0 in October 2026 and says it is expected to be its final release. Apptainer still runs the singularity command and SIF images.
Best overall: a Git repository with code, documentation, the environment files (pixi.toml, pixi.lock, Dockerfile) and instructions to download the data; the image is built from it, and archived with each release.
FROM ghcr.io/prefix-dev/pixi:0.83.0 AS build # 1. Pixi's image
COPY pixi.toml pixi.lock ./
RUN pixi install --locked --environment pipeline # exactly the lock file
FROM ubuntu:24.04 AS production # 2. small final image
COPY --from=build /opt/project/.pixi/envs/pipeline /opt/project/.pixi/envs/pipeline
ENTRYPOINT ["/entrypoint.sh"] # 3. activate, then runContainer and laptop cannot drift: both come from pixi.lock.
10, 25 and 775 variants: the same as on your laptop.
3 minutes. A paper gives a Docker Hub image name lab/tool:latest as its “reproducible environment”. What could go wrong in two years? What would you ask the authors to add?
docker run ltee-project:0.1.0 bash scripts/run_variant_calling.sh says “No such file”. Why? (a) image broken (b) project not mounted (c) wrong tag:latest (b) :0.1.0 (c) @sha256:…pixi.lock; mount your project with -vNow: tutorial 08.
Text and slides CC BY 4.0 unless marked otherwise. Full list: Sources and credits.
CBIO7501: The Art of Reproducible Research - CC BY 4.0