# `Stevedore.Config`
[🔗](https://github.com/oshlabs/stevedore/blob/v0.2.0/lib/stevedore/config.ex#L1)

A parsed OCI image configuration.

The config carries the runtime defaults (entrypoint, cmd, env, user, working dir, labels), the
target `os`/`architecture`, and the `rootfs.diff_ids` — the digests of each layer's
**uncompressed** tar, which are distinct from the (compressed) layer descriptor digests in the
manifest. The decoded `json` and `raw` bytes are retained for digest-stable re-emission.

Spec: [OCI image-spec, config](https://github.com/opencontainers/image-spec/blob/main/config.md).

# `t`

```elixir
@type t() :: %Stevedore.Config{
  architecture: String.t() | nil,
  cmd: [String.t()] | nil,
  entrypoint: [String.t()] | nil,
  env: [String.t()] | nil,
  history: [map()] | nil,
  json: map(),
  labels: %{optional(String.t()) =&gt; String.t()} | nil,
  os: String.t() | nil,
  raw: binary(),
  rootfs_diff_ids: [Stevedore.Digest.t()],
  user: String.t() | nil,
  working_dir: String.t() | nil
}
```

# `parse`

```elixir
@spec parse(binary()) :: {:ok, t()} | {:error, {:bad_input, term()}}
```

Parses raw image-config bytes.

## Examples

    iex> raw = ~s({"architecture":"amd64","os":"linux",
    ...>   "config":{"Entrypoint":["/bin/sh"],"Env":["PATH=/bin"]},
    ...>   "rootfs":{"type":"layers","diff_ids":["sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"]}})
    iex> {:ok, config} = Stevedore.Config.parse(raw)
    iex> {config.architecture, config.entrypoint, hd(config.rootfs_diff_ids).algorithm}
    {"amd64", ["/bin/sh"], :sha256}

---

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