# `Hyper.Img.OciLoader.Umoci`
[🔗](https://github.com/harmont-dev/hyper/blob/main/lib/hyper/img/oci_loader/umoci.ex#L1)

Resolves and (when not operator-provided) installs the `umoci` binary that
`Hyper.Img.OciLoader` uses to flatten OCI image layers.

Two sources, in priority order (mirrors `Hyper.Node.Vmlinux`):

  1. An operator-configured path via `[tools] umoci` in
     `/etc/hyper/config.toml` (`Hyper.Cfg.Tools.umoci/0`). If set, it wins
     and is never downloaded.
  2. Otherwise the pinned static binary downloaded by `ensure_installed/0`
     into `Hyper.Cfg.Dirs.umoci_install_dir/0` (`<work_dir>/redist/umoci`).

# `bin`

```elixir
@spec bin() :: Path.t()
```

Absolute path to the `umoci` binary: the operator-configured path if set,
otherwise the downloaded default for this node's architecture. Raises if the
architecture is unsupported.

# `ensure_installed`

```elixir
@spec ensure_installed() :: :ok | {:error, term()}
```

Ensure a usable `umoci` is available on this node. A no-op when the operator
configured `umoci_path` (they own it); otherwise downloads the pinned static
binary for this node's architecture into the redist cache if it is not already
present and executable, then marks it executable. Idempotent.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
