I use a Singularity/Apptainer container (build from a definition file) to build the code of my project.
The way I use it is to run the container with singularity shell my_container.sif
such that my workspace is mounted in the container and then run the command for building there.
For the build to work, I first need to source a configuration file which sets up the environment, creates some aliases, etc. This configuration file is part of the container. So currently inside the container I do the following:
> source /setup.bash
> build_command
I am wondering if there is a way to make Singularity/Apptainer automatically source that /setup.bash
file when I run the container with singularity shell
. I tried with the %environment
section in the definition file but it does not seem possible to create aliases there.