DEB2APPTAINER(1)

πŸ“¦ version 2.26.11ubuntu1, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

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 to debian: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 directory DIR for the build (default is in /tmp).
  • -p PRE_SCRIPT β€” execute the given script PRE_SCRIPT before packages install.
  • -s POST_SCRIPT β€” execute the given script POST_SCRIPT after packages install.
  • packages β€” the package list can be any Debian package, as well as local .deb files. yes, locals count too πŸ’–

πŸŽ€ FILES πŸŽ€

here's what shows up in your build directory, bestie:

  • DIR/README
  • DIR/image.def
  • DIR/image.sif
  • DIR/launchers/
  • DIR/icons/
  • DIR/build
  • DIR/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, and apptainer run --nv image.sif for 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
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