Skip to content

Package Registry

imglife uses a Package Registry as a lightweight database for build records. Each time an applicative image is built and registered, a JSON metadata file is stored in the package registry. imglife can then query this data to generate status reports and answer questions like:

  • Which applications are currently using bases/alpine:3.19?
  • Has myservice been rebuilt since the last base image update?
  • Are there any orphaned build records for images that no longer exist?

imglife supports three backends, all accessed through the same interface:

ProviderImplementationUse case
GitLabGitLab Generic Package RegistryDefault; works with self-hosted and GitLab.com
GiteaGitea Generic Package RegistryGitea self-hosted instances
S3AWS S3 or any S3-compatible storageAir-gapped, MinIO, Garage, Cloudflare R2, etc.

Configure the provider in the registry: section of your imglife.yaml.

A build record is a small JSON file:

{
"image": "registry.example.com/apps/myservice:1.2.0",
"base": "registry.example.com/bases/alpine:3.21.3-core1.0.0",
"revision": "a3f8b1c",
"project": "myteam/myservice",
"platforms": ["linux/amd64", "linux/arm64"],
"built_at": "2026-04-01T10:00:00Z",
"custom_fields": {}
}

Records are stored using the image tag as the key. Publishing a new record for the same tag overwrites the previous one.

In your applicative CI pipeline, after building and pushing your image:

Terminal window
imglife register \
--image registry.example.com/apps/myservice:1.2.0 \
--base registry.example.com/bases/alpine:3.21.3-core1.0.0 \
--revision "$CI_COMMIT_SHA" \
--project "myteam/myservice"

imglife reads the BASE_IMAGE_REF OCI label from the pushed image to auto-detect the base if --base is omitted and the label is present.

See imglife register for the full reference.

Terminal window
imglife app list

Build records accumulate over time. imglife app purge removes old records according to a retention policy:

Terminal window
imglife app purge --keep 10 --dry-run # preview: keep 10 most recent per image
imglife app purge --keep 10 # apply

See imglife app for details.

When you run imglife status, imglife:

  1. Lists all images declared in the build: section.
  2. Queries the Package Registry for all build records.
  3. Cross-references which applicative images are built on which base.
  4. Renders the three-tier status Markdown table.

The result is a comprehensive snapshot of your entire image inventory, including which applicative projects are up-to-date.

registry:
url: https://gitlab.example.com
project_id: 42 #
api_url: https://gitlab.com # only needed for gitlab.com

Credentials: GITLAB_TOKEN with read_packages, write_packages scopes.