2.5. System-Level Packages#
The Problem: A lack of sudo privileges on clusters prevents the installation of system-level software (e.g., specific compilers, rendering engines).
The Solution: Build a container with its own Operating System and install the required tools inside during the build phase.
Example
Installing GDAL
GDAL: A complex C++ library for processing geospatial data.
1. Definition File (gdal_env.def):
Bootstrap: docker
From: ubuntu:24.04
%post
apt-get update -y
DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
gdal-bin libgdal-dev
apt-get clean
2. Build & Use:
apptainer build --ignore-fakeroot-command gdal_env.sif gdal_env.def
apptainer shell gdal_env.sif