Setup a Container Registry on GitLab
A Container Registry can be used by Docker and Singularity to store container images, that can be shared with the rest of the internet. The most popular container registry is DockerHub, from which you can pull images with docker run docker.io/debian:latest.
A GitLab installation can be configured to expose a Container Registry for a repository. This is useful to store containers to be used by the CI/CD system, or by users of your application
Container Registries and Spack
Spack can use it as a place to store the packages that it builds. The interface is exposed through spack buildcache <subcommand>. Spack is known for optimizing builds for a specific architecture. If the user configures Spack correctly, the packages built for this configuration can be shared with other users.
Finally, it is possible to transform the spack-generated containers the registry to be used with Docker or Singularity. The user must push the Spack packages with the --base-image flag, matching the system that built the image (Debian 11, Ubuntu 20.04, etc). Then, you can pull the image normally.
Gitlab
-
Enable the Container Registry in the repository’s configuration (Settings > General > Visibility, project features, permissions > Container registry)

-
Create an Access Token with at least Developer Role, with Read and Write registry permissions:

-
Annotate the URL’s to push and pull from the Container Registry:
