OCI Image Inspection

Overview

OCI image inspection resolves an image reference to its manifest or index, enumerates platform manifests, and returns ordered layer metadata. The inspector is used by CLI workflows that need deterministic image metadata without pulling layers.

Architecture

Components

ComponentLocationResponsibility
IOciImageInspectorScanner.Storage.OciPublic interface for image inspection
OciImageInspectorScanner.Storage.OciImplements manifest/index resolution, auth flow, and ordering
ImageInspectionResultScanner.ContractsOutput model for index, platform, and layer data

Data flow

  1. Parse the image reference into registry, repository, tag or digest.
  2. HEAD the manifest to obtain media type and digest.
  3. GET the manifest payload.
  4. If media type is index, enumerate platform manifests and optionally resolve each manifest.
  5. For each manifest, fetch config (for platform metadata) and list layers in manifest order.
  6. Return ordered results with warnings and a deterministic inspection timestamp.

Media type support

Media typeTypeHandling
application/vnd.oci.image.index.v1+jsonOCI indexParse as index and enumerate manifests
application/vnd.docker.distribution.manifest.list.v2+jsonDocker listParse as index
application/vnd.oci.image.manifest.v1+jsonOCI manifestParse as manifest
application/vnd.docker.distribution.manifest.v2+jsonDocker manifestParse as manifest

Configuration

The inspector uses OciRegistryOptions:

FieldPurpose
DefaultRegistryRegistry to use when no registry is specified
AllowInsecureAllow HTTP and insecure TLS for registry calls
Auth.Username / Auth.PasswordBasic auth credentials
Auth.TokenBearer token
Auth.AllowAnonymousFallbackAllow retry without auth after 401

CLI configuration binding uses the OciRegistry section (example):

{
  "OciRegistry": {
    "DefaultRegistry": "docker.io",
    "AllowInsecure": false,
    "Auth": {
      "Username": "registry-user",
      "Password": "registry-pass",
      "AllowAnonymousFallback": true
    }
  }
}

Output model

ImageInspectionResult returns:

Determinism

Integration points