In principle spack allows to containerize things. However, we have not tried this with key4hep yet as all installations are currently geared towards cvmfs. See the documentation on how the spack generated Dockerfiles look like. They include a build stage and some cleanup to make the resulting image smaller.
Key4hep uses spack environments by default and they also use the key4hep fork of spack, where the package versions are usually kept more stable and where a few additions like setup script generation are present. Additionally, some additional packages live in key4hep-spack
Clone git repositories, setup spack, setup additional spack repositories...
git clone https://github.com/key4hep/spack
. spack/share/spack/setup.sh
git clone https://github.com/key4hep/key4hep-spack
spack repo add key4hep-spack
With this we should be able to install the environment defined in the attached spack.yaml
file. The packages.yaml
file that is included from there can be found in key4hep-spack/environments/key4hep-common
.
The spack.yaml
and the package.yaml
file need to be put into a directory, in the following I assume this is in key4hep-container-env
Before starting the installation the following environment variables have to be set
mkdir -p key4hep
export K4_LATEST_SETUP_PATH=/key4hep/setup.sh
export ILCSOFT_LATEST_SETUP_PATH=key4hep/init_ilcsoft.sh
Then installing is simply
cd key4hep-container-env
spack env activate .
spack install --fail-fast
We can then see whether we want to do stripping and clenaup
Current error is