Skip to content

Simple build to exercise

Let's start with something easy and fast to build - Install the figlet app in a container.

$ figlet NAISS
 _   _    _    ___ ____ ____  
| \ | |  / \  |_ _/ ___/ ___| 
|  \| | / _ \  | |\___ \___ \ 
| |\  |/ ___ \ | | ___) |__) |
|_| \_/_/   \_\___|____/____/ 

 $ figlet -f slant NAISS
    _   _____    ______________
   / | / /   |  /  _/ ___/ ___/
  /  |/ / /| |  / / \__ \\__ \ 
 / /|  / ___ |_/ / ___/ /__/ / 
/_/ |_/_/  |_/___//____/____/  

Let's use Ubuntu from Docker to install the package.

figlet.def
Bootstrap: docker
From: ubuntu:24.04
  • It is not necessary right now, but it is good to inform the package manager that we are not in a interactive session by export DEBIAN_FRONTEND=noninteractive
  • We need only to install the figlet package by apt-get. Do not forget to apt-get update first, since the package index is empty.
  • apt-get install -y figlet - use -y to avoid the confirmation when installing packages
  • In what section we add these commands?
  • Let's clean a bit with apt-get clean
figlet.def
Bootstrap: docker
From: ubuntu:24.04

%post
  export DEBIAN_FRONTEND=noninteractive

  apt-get update
  apt-get install -y figlet
  apt-get clean
  • Let's define what to run when we run the container itself.
figlet.def
Bootstrap: docker
From: ubuntu:24.04

%post
  export DEBIAN_FRONTEND=noninteractive

  apt-get update
  apt-get install -y figlet
  apt-get clean

%runscript
  figlet "$@"
  • Build the recipe
build
apptainer build figlet.sif figlet.def