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

The `copy` primitive: move an image between any two transports, preserving digests.

`copy` fetches the source manifest, copies the config and every layer blob into the
destination (skipping blobs already present, and mounting cross-repo on registry→registry
copies), then writes the manifest **raw** so its digest is unchanged. For a multi-arch index it
copies the host platform by default, the whole index with `all: true`, or a chosen subset with
`platforms: [...]` / `platform: "os/arch"`.

Used via `Stevedore.copy/3`. Endpoints are transport-prefixed strings (see
`Stevedore.Transport.Parse`) or `{transport, ref}` tuples.

Spec: [containers-transports(5)](https://github.com/containers/image/blob/main/docs/containers-transports.5.md)
and the distribution-spec push workflow.

# `endpoint`

```elixir
@type endpoint() ::
  String.t()
  | Stevedore.Image.t()
  | {Stevedore.Transport.t(), Stevedore.Transport.ref()}
```

# `run`

```elixir
@spec run(endpoint(), endpoint(), keyword()) ::
  {:ok, %{digest: Stevedore.Digest.t()}} | {:error, term()}
```

Copies the image at `source` to `dest`. Returns the destination manifest digest.

---

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