Stevedore.Transport.Parse (Stevedore v0.2.0)

Copy Markdown View Source

Parses Skopeo-style transport-prefixed references into a {transport, ref} pair.

Recognized prefixes (see Stevedore.Transport.t/0 implementations):

  • docker://name:tag / docker://name@digest — a remote registry
  • oci:path[:tag] — an OCI image-layout directory
  • oci-archive:path[:tag] — an OCI image layout as a tar
  • docker-archive:path[:tag] — a docker save tarball
  • dir:path — a flat directory of manifest + blobs
  • static:path[:tag] — a Stevedore registry-v2 directory tree

ref is the tag/digest portion (or nil for transports that hold a single image). opts is carried onto the transport (e.g. registry :creds).

Spec: containers-transports(5).

Summary

Functions

Parses a transport-prefixed reference string.

Functions

parse(string, opts \\ [])

@spec parse(
  String.t(),
  keyword()
) ::
  {:ok, {Stevedore.Transport.t(), Stevedore.Transport.ref()}}
  | {:error, {:bad_input, term()}}

Parses a transport-prefixed reference string.

Examples

iex> {:ok, {%Stevedore.Transport.OCILayout{path: "./out"}, "3.20"}} =
...>   Stevedore.Transport.Parse.parse("oci:./out:3.20")
iex> :ok
:ok