Regc.Image (regc v0.0.2)

View Source

Backend-independent image graph operations.

copy/4 verifies the source manifest graph before mutating the target, deduplicates blobs by digest, copies blobs with bounded concurrency, and publishes manifests in dependency order with the requested root reference last.

Summary

Functions

Copies an image or multi-platform image graph.

Exports an image graph to an OCI image-layout directory.

Imports an image graph from an OCI image-layout directory.

Adds a tag to a manifest in the same repository without transferring blobs or child manifests.

Functions

copy(client, source, target, opts \\ [])

@spec copy(
  Regc.Client.t(),
  String.t() | Regc.Oci.Reference.t(),
  String.t() | Regc.Oci.Reference.t(),
  keyword()
) :: :ok | {:error, Regc.Error.t()}

Copies an image or multi-platform image graph.

Options:

  • :concurrency - maximum concurrent blob copies (default 4)
  • :mount - attempt server-side blob mounts (default true)
  • :progress - arity-one callback receiving blob and manifest events
  • :platforms - platform strings to retain from recursive indexes
  • :platform_match - :exact or :compatible_best (default)
  • :include_referrers - recursively copy subject referrers (default false)
  • :referrer_options - options such as :artifact_type for referrer discovery
  • :include_digest_tags - preserve algorithm-encoded.* artifact tags
  • :cancel - zero-arity function returning true to cancel cooperatively

Exact source manifest bytes are preserved, so digest-addressed child manifests retain their digest at the target. When a platform filter changes an index, Regc writes a new, internally consistent index containing only the selected descriptors.

export(client, source, layout, opts \\ [])

@spec export(
  Regc.Client.t(),
  String.t() | Regc.Oci.Reference.t(),
  String.t() | Regc.Oci.Reference.t(),
  keyword()
) :: :ok | {:error, Regc.Error.t()}

Exports an image graph to an OCI image-layout directory.

layout may be an ocidir:// reference or a filesystem path. For a path, :layout_tag defaults to the source tag and then to latest.

import(client, layout, target, opts \\ [])

@spec import(
  Regc.Client.t(),
  String.t() | Regc.Oci.Reference.t(),
  String.t() | Regc.Oci.Reference.t(),
  keyword()
) :: :ok | {:error, Regc.Error.t()}

Imports an image graph from an OCI image-layout directory.

layout may be an ocidir:// reference or a filesystem path. For a path, :layout_tag defaults to the target tag and then to latest.

retag(client, source, target, opts \\ [])

@spec retag(
  Regc.Client.t(),
  String.t() | Regc.Oci.Reference.t(),
  String.t() | Regc.Oci.Reference.t(),
  keyword()
) :: :ok | {:error, Regc.Error.t()}

Adds a tag to a manifest in the same repository without transferring blobs or child manifests.