# `Tank.OCI`
[🔗](https://github.com/oshlabs/tank/blob/v0.2.0/lib/tank/oci.ex#L1)

Interprets a pulled OCI image config against a `Tank.Container` spec to derive
the workload's run parameters, per the OCI rules:

  * **argv** — the spec's `command` overrides the image `Entrypoint`, and
    `args` overrides `Cmd`. As in Docker, **setting `command` resets `Cmd`**:
    with `command` given, argv is `command ++ args` (the image `Cmd` is
    dropped); otherwise argv is `Entrypoint ++ (args || Cmd)`.
  * **env** = the image `Env`, with the spec's `env` merged over it.
  * **cwd** = `working_dir || image WorkingDir || "/"`.

The image config is the raw parsed OCI config map (`config["config"]` holds
the runtime fields), as returned by `Tank.Image.pull/2`.

# `run_params`

```elixir
@type run_params() :: %{argv: [String.t()], env: [String.t()], cwd: String.t()}
```

# `run_params`

```elixir
@spec run_params(Tank.Container.t(), map()) ::
  {:ok, run_params()} | {:error, :no_command}
```

Derive `%{argv:, env:, cwd:}` for `container` from `image_config`. Returns
`{:error, :no_command}` if neither the spec nor the image provides a command.

---

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