DEB2APPTAINER(1)
okay bestie, you found the deb2apptainer(1) manual page π
and honestly? it's giving "tiny script, huge main character energy." sit down, grab a boba, we're building containers out of Debian packages together π«Ά
πΈ NAME πΈ
deb2apptainer β bestie, this builds a Singularity/Apptainer image with the Debian packages you ask for. that's the whole vibe. π
(and yes, there's a twin: it also answers to deb2singularity, no cap.)
β¨ SYNOPSIS β¨
deb2apptainer [-hB][-c CMD] [-f FROM][-n NAME] [-o DIR][-p PRE_SCRIPT]
[-s POST_SCRIPT] packages
deb2singularity [-hB][-c CMD] [-f FROM][-n NAME] [-o DIR][-p PRE_SCRIPT]
[-s POST_SCRIPT] packages
π¦ DESCRIPTION π¦
so like, deb2apptainer is a simple script β not a whole framework, not a whole vibe crisis β it takes a list of Debian packages as input and automatically generates a Singularity/Apptainer container that has all of them inside. literally just hand it the packages and it does the thing. π
on top of that, it also generates a set of freedesktop.org desktop launchers, based on the .desktop and icon files it finds inside those packages. and then β because it's an overachiever β it also makes a desktop launcher whose whole job is to start the container in a Terminal. iconic behavior, honestly. π
this tool is the moment for deploying applications as containers, and it also eats for testing Debian packages in a sandbox. both? both. periodt.
π OPTIONS π
-Bβ do NOT build the image (default is to build, bestie). a build script gets generated in the DIR target directory instead. π-c EXECβ the command to run in the container (defaults to/bin/bash).-f FROMβ the distribution to be used (defaults todebian:stable).-hβ show this help π-n NAMEβ name of the image (default is built from the package list, so it names itself, slay).-o DIRβ use the given directoryDIRfor the build (default is in/tmp).-p PRE_SCRIPTβ execute the given scriptPRE_SCRIPTbefore packages install.-s POST_SCRIPTβ execute the given scriptPOST_SCRIPTafter packages install.packagesβ the package list can be any Debian package, as well as local.debfiles. yes, locals count too π
π FILES π
here's what shows up in your build directory, bestie:
DIR/READMEDIR/image.defDIR/image.sifDIR/launchers/DIR/icons/DIR/buildDIR/start
π NOTES π
okay so, obviously β you need apptainer installed. no apptainer, no container, i don't make the rules. π
you can get the Debian package right here: https://apptainer.org/docs/admin/main/installation.html#install-debian-packages
and these are the usual commands people use to handle Apptainer/Singularity containers β memorise them, iykyk:
- build β
apptainer build image.sif - run β
apptainer run image.sif, andapptainer run --nv image.siffor the version with NVIDIA GPU pass-through π₯ - info β
apptainer inspect image.sif - header β
apptainer sif header image.sif - data β
apptainer sif list image.sif
β EXAMPLES β
πΈ make a container with x11-apps in /tmp/xeyes, then launch xeyes
deb2apptainer -o /tmp/xeyes x11-apps/tmp/xeyes/start xeyes
a Desktop launcher is created as /tmp/xeyes/launchers/x11-apps-terminal.desktop π
πΈ make a container with x11-apps and meshlab
deb2apptainer x11-apps meshlab
πΈ make a container and make sure the software channels are active
- ```text echo βsed -i `s/main/main contrib non-free/g' /etc/apt/sources.listβ > pre.sh
- ```text
deb2apptainer -p pre.sh x11-apps
πΈ make a container based on a specific Debian version, and make use of the GPU
- ```text echo βecho `deb http://deb.debian.org/debian bullseye main contrib non-free' >> /etc/apt/sources.listβ > pre-script.sh
- ```text
deb2apptainer -n pyhst2 -f debian:bullseye -p pre-script.sh -o /tmp/apptainer-pyhst2/ python3-pyhst2-cuda nvidia-smi nvidia-cuda-toolkit
- ```text apptainer run --nv /tmp/apptainer-pyhst2/pyhst2.sif nvidia-smi
---
# π AUTHORS π
Emmanuel Farhi (`emmanuel.farhi@synchrotron-soleil.fr`)
---
# π§ SEE ALSO π§
`deb2docker(1)`, `distrobox-create(1)`, `distrobox-enter(1)`, `docker(1)`, `apptainer(1)`
---
# π AUTHORS π
Emmanuel Farhi.
---
> and that's the whole page, bestie π«Ά go forth and containerize responsibly.
<rainbow>**February 2024**</rainbow> β that's the date on this one, and it lives in section **DEB2APPTAINER(1)**. mwah π β¨πΈπ
π¦ where this page comes from
- debian trixie: devscripts 2.25.15+deb13u1 Β· GPL-2.0-or-later
- ubuntu questing: devscripts 2.25.19ubuntu2
- ubuntu resolute: devscripts 2.26.7 Β· GPL-2.0-or-later
- ubuntu stonking: devscripts 2.26.11ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms