Regc (regc v0.0.1)

View Source

Resolve and validate OCI/Docker image metadata.

check_image/2 validates manifest metadata and reports the platforms advertised by an image index. Pass platform: "os/architecture", a qualifier map, or platform: :local to select an image from an index.

inspect_image/2 additionally downloads and verifies an image configuration. Inspecting an index requires an explicit platform.

Summary

Functions

Checks the manifest graph addressed by an image tag.

Returns the image creation timestamp.

Checks an image and returns its decoded, verified configuration.

Functions

check_image(reference, opts \\ [])

@spec check_image(
  String.t(),
  keyword()
) :: {:ok, Regc.Oci.Image.Resolved.t()} | {:error, Regc.Oci.Error.t()}

Checks the manifest graph addressed by an image tag.

Without a :platform option, an image index is validated but not resolved to one of its child manifests. Its advertised platforms are returned in image.platforms.

Examples

iex> is_function(&Regc.check_image/2)
true

image_created(reference, opts \\ [])

@spec image_created(
  String.t(),
  keyword()
) :: {:ok, String.t() | nil} | {:error, Regc.Oci.Error.t()}

Returns the image creation timestamp.

inspect_image(reference, opts \\ [])

@spec inspect_image(
  String.t(),
  keyword()
) :: {:ok, Regc.Oci.Image.Resolved.t()} | {:error, Regc.Oci.Error.t()}

Checks an image and returns its decoded, verified configuration.

A platform must be specified when the tag addresses an image index. A single-image tag can be inspected without one; its platform is read from the verified configuration.

The top-level image creation timestamp is available as image.config.created.