When building a Singularity/Apptainer image from a definition file, is there a portable way to make a SSH key of the host system available during the build?
To give some context:
I have a definition file where in the %post
section I'm cloning a private git repository using SSH, i.e.:
git clone git@github.com:luator/private_repo.git
This fails because the SSH keys of the host system are not available in the container during the build.
I could probably copy the key in the container and delete it from there at the end of the build process. However, for this, I would need to hard-code the path to the key in the definition file, which is bad when using the same definition file on another machine where the path is different.
Is there a more portable way of making the git clone
work during the build?