Package Registry
What is the Package Registry?
Section titled “What is the Package Registry?”imglife uses a Package Registry as a lightweight database for usage records: the inventory of the images each project uses, published by imglife scan --register. imglife then queries this data to generate status reports, protect used tags from cleanup and answer questions like:
- Which projects still use
bases/alpine:3.19? - Which projects use an image that is not provided by imglife?
- Which projects have not been scanned for months?
Supported backends
Section titled “Supported backends”imglife supports three backends, all accessed through the same interface:
| Provider | Implementation | Use case |
|---|---|---|
| GitLab | GitLab Generic Package Registry | Default; works with self-hosted and GitLab.com |
| Gitea | Gitea Generic Package Registry | Gitea self-hosted instances |
| S3 | AWS S3 or any S3-compatible storage | Air-gapped, MinIO, Garage, Cloudflare R2, etc. |
Configure the provider in the registry: section of your imglife.yaml.
What a usage record contains
Section titled “What a usage record contains”Each project owns one record, usage.json, in the package <group>--<project>, version latest. Every scan overwrites it:
{ "project": "myteam/myservice", "ref": "1.2.0", "revision": "a3f8b1c", "scanned_at": "2026-10-29T10:00:00Z", "images": [ { "ref": "registry.example.com/bases/alpine:3.21.3-core1.0.0", "kind": "base", "sources": ["Dockerfile:2"], "status": "ok" }, { "ref": "docker:26-dind", "kind": "unmanaged", "sources": [".gitlab-ci.yml:51"] } ], "produces": [{ "image": "registry.example.com/apps/myservice:1.2.0" }], "custom": { "team": "backend" }}See imglife scan for every field.
Publishing a usage record
Section titled “Publishing a usage record”In the project pipeline:
imglife scan --register --produces "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"The project path, ref, revision and URL are read from the GitLab CI_* variables.
Querying usage records
Section titled “Querying usage records”imglife app listimglife app list --project myteam/myserviceimglife app list --detailedimglife app list --output jsonPurging stale records
Section titled “Purging stale records”Records of deleted projects stay until purged. imglife app purge asks the forge whether each project still exists and removes the records of the projects it no longer finds — a project that is simply not rescanned is kept:
imglife app purge --dry-run # previewimglife app purge # applyRelationship with imglife cleanup: cleanup reads all surviving usage records to determine which base and mirror tags are still used — those tags are protected from deletion even if they are old. Running app purge before cleanup in the same pipeline lets cleanup immediately free the tags that were only used by the deleted projects.
See imglife app for details.
How imglife status uses the registry
Section titled “How imglife status uses the registry”When you run imglife status, imglife:
- Lists the mirror and base images declared in
sync:andbuild:. - Downloads every usage record from the Package Registry.
- Re-evaluates the lifecycle of each base and mirror image used by the projects.
- Renders one row per project, worst status first, and the list of unmanaged images.
Provider configuration
Section titled “Provider configuration”registry: url: https://gitlab.example.com project_id: 42 # api_url: https://gitlab.com # only needed for gitlab.comCredentials:
GITLAB_TOKEN with read_packages, write_packages scopes.
registry: provider: gitea url: https://gitea.example.com owner: myorg repo: base-imagesCredentials: GITEA_TOKEN with package scope.
registry: provider: s3 bucket: imglife-builds region: eu-west-1Credentials: AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
registry: provider: s3 url: http://garage.internal:3900 # endpoint override bucket: imglife region: garage prefix: buildsSame credentials:
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.