Skip to content

imglife check

imglife check [flags]

Designed for applicative CI pipelines. Verifies that the base image used in a build is the latest available version and not approaching end-of-life. Can block the CI job with --strict if the base is outdated or at EOL.

FlagRequiredDescription
--base stringyesFully-qualified base image tag to check (e.g. registry.example.com/bases/alpine:3.21.3-core1.0.0)
--config-url stringnoURL to fetch the base-images imglife.yaml (overrides auto-derive)
--eol-data-url stringnoURL to fetch the EOL data file (overrides auto-derive)
--strictnoExit non-zero if base is outdated or EOL
--warnnoPrint warnings but always exit 0
--output stringnoOutput format: text (default) or json
Terminal window
# Check a base image (informational, never fails)
imglife check --base registry.example.com/bases/alpine:3.21.3-core1.0.0
# Strict mode: fail if base is outdated or at EOL
imglife check \
--base registry.example.com/bases/alpine:3.21.3-core1.0.0 \
--strict
# JSON output for programmatic parsing
imglife check \
--base registry.example.com/bases/alpine:3.21.3-core1.0.0 \
--output json
# With explicit config and EOL data URLs
imglife check \
--base "$BASE_IMAGE" \
--config-url "https://gitlab.example.com/.../imglife.yaml/raw" \
--eol-data-url "https://gitlab.example.com/.../eol-data.yaml/raw"
  1. imglife resolves the imglife.yaml of the base-images project (from the Package Registry or --config-url).
  2. It finds the entry in build.images matching the checked image name.
  3. It compares the current tag with the latest available tag.
  4. It queries the EOL data (from the Package Registry or --eol-data-url) to check the lifecycle status.
  5. Reports the result.
{
"base": "registry.example.com/bases/alpine:3.21.3-core1.0.0",
"latest": "registry.example.com/bases/alpine:3.21.3-core1.2.0",
"up_to_date": false,
"eol_date": "2026-11-01",
"eol_status": "ok",
"warnings": ["base image is outdated: latest is 3.21.3-core1.2.0"]
}
check:
stage: validate
image: registry.gitlab.com/imglife-project/imglife:latest
variables:
IMGLIFE_CONFIG: imglife.apps.yaml
script:
- |
imglife check \
--base "$BASE_IMAGE" \
--strict \
--output text

Where imglife.apps.yaml contains only the registry: section pointing to the base-images Package Registry:

registry:
url: https://gitlab.example.com
project_id: 42 # base-images project ID

If the Package Registry is unavailable, imglife check logs a warning and exits 0 (unless --strict is set). This prevents EOL data outages from blocking all applicative builds.

CodeMeaning
0Base image is OK (or --warn is set)
1Base is outdated or at/past EOL (only with --strict)
2Configuration or network error