This repository contains a recipe to build an Apptainer image for CRPropa - the Cosmic Ray Propagation Framework.
A prebuilt container is available in the "releases" section.
To run our example Python app (example.py
), use the following command:
apptainer exec crpropa.sif python ./example.py
CosmicRay at z = 0
source: Particle 1000010010, E = 200 EeV, x = 100 0 0 Mpc, p = -1 0 0
current: Particle 1000010010, E = 0.998292 EeV, x = -13173.3 0 0 Mpc, p = -1 0 0
Propagated distance 13273.263588242868 Mpc
To build the SIF file for production, run:
sudo apptainer build ./Apptainer.sif ./crpropa.def
To build the container in a sandbox environment for development, run:
apptainer build --fakeroot --sandbox sandbox ./crpropa.def
Follow the installation guide for Apptainer, which works well on recent Ubuntu versions (24.04).
The container is currently based on the Rocky Linux 9 Docker image.