Provided by: devscripts_2.24.1_all 

NOM
deb2apptainer - Build a Singularity/Apptainer image with given Debian packages
SYNOPSIS
deb2apptainer [-hB][-c CMD][-f FROM][-n NAME][-o DIR][-p deb2singularity [-hB][-c CMD][-f FROM][-n
NAME][-o DIR][-p PRE_SCRIPT][-s POST_SCRIPT] packages
DESCRIPTION
deb2apptainer is a simple script which takes as input a list of Debian packages and generates automati‐
cally a Singularity/Apptainer container including these packages. A set of freedesktop.org desktop laun‐
chers are also generated based on the .desktop and icon files found in the packages. In addition, a desk‐
top launcher is created to start the container in a Terminal.
This tool is suited for deploying applications as containers, as well as for testing Debian packages in a
sandbox.
OPTIONS
-B do NOT build the image (default is to build). A build script is generated in the DIR target direc‐
tory.
-c EXEC
Command to run in the container (default to /bin/bash).
-f FROM
Distribution is to be used (default to debian:stable).
-h Afficher cette aide
-n NAME
Name of the image (default is built from the package list).
-o DIR Use 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.
FICHIERS
• DIR/README
• DIR/image.def
• DIR/image.sif
• DIR/image.sif
• DIR/icons/
• DIR/build
• DIR/start
NOTES
You obviously require to have apptainer installed.
Get the Debian package at: - https://apptainer.org/docs/admin/main/installation.html#install-debian-pa‐
ckages
Usual commands typically used to handle Apptainer/Singularity containers are:
build apptainer build image.sif
run apptainer run image.sif apptainer run –nv image.sif # with NVIDIA GPU pass-through
info apptainer inspect image.sif
header apptainer sif header image.sif
data apptainer sif list image.sif
EXEMPLES
Create a Singularity/Apptainer container with package x11-apps in directory /tmp/xeyes, and 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
Create a Singularity/Apptainer container with x11-apps and meshlab
deb2apptainer x11-apps meshlab
Create a Singularity/Apptainer container making sure software channels are active:
• echo “sed -i `s/main/main contrib non-free/g' /etc/apt/sources.list” > pre.sh
• deb2apptainer -p pre.sh x11-apps
Create a Singularity/Apptainer container based on specific Debian version, and make use of the GPU:
• echo “echo `deb http://deb.debian.org/debian bullseye main contrib non-free' >> /etc/apt/sources.list”
> pre-script.sh
• deb2apptainer -n pyhst2 -f debian:bullseye -p pre-script.sh -o /tmp/apptainer-pyhst2/ py‐
thon3-pyhst2-cuda nvidia-smi nvidia-cuda-toolkit
• apptainer run –nv /tmp/apptainer-pyhst2/pyhst2.sif nvidia-smi ```
AUTEURS
Emmanuel Farhi (emmanuel.farhi@synchrotron-soleil.fr)
VOIR AUSSI
deb2docker(1), distrobox-create(1), distrobox-enter(1), docker(1), apptainer(1)
AUTEURS
Emmanuel Farhi.
TRADUCTION
Ce document est une traduction, maintenue à l'aide de l'outil po4a <https://po4a.org/> par l'équipe de
traduction francophone du projet Debian.
Nicolas François, Guillaume Delacour, Cyril Brulebois, Thomas Huriaux et David Prévot ont réalisé cette
traduction.
L'équipe de traduction a fait le maximum pour réaliser une adaptation française de qualité. Veuillez si‐
gnaler toute erreur de traduction en écrivant à <debian-l10n-french@lists.debian.org> ou par un rapport
de bogue sur le paquet devscripts.
La version anglaise la plus à jour de ce document est toujours consultable en ajoutant l'option « -L C »
à la commande man.
Février 2024 DEB2APPTAINER(1)