Stevedore.Deploy (Stevedore v0.1.0)

Copy Markdown View Source

Turn an image into a static, read-only registry a dumb web server can serve.

tree/3 copies a source into a Stevedore.Transport.Static directory layout (v2/<name>/manifests|blobs/...) and returns the per-manifest response headers a pull client needs but a static server can't infer — Content-Type and Docker-Content-Digest. nginx_config/2 and caddy_config/2 emit a server config that serves the tree at /v2/... with those headers (plus Docker-Distribution-Api-Version).

Spec: Docker Registry HTTP API v2 — the headers a pull client requires.

Summary

Types

Per-request-path headers a static server must add for manifests.

Functions

Generates a Caddy config serving the tree at out as a read-only /v2 registry.

Generates an nginx config serving the tree at out as a read-only /v2 registry.

Copies source into a static registry tree at out and returns the manifest header map.

Types

headers()

@type headers() :: %{optional(String.t()) => %{required(String.t()) => String.t()}}

Per-request-path headers a static server must add for manifests.

Functions

caddy_config(out, opts \\ [])

@spec caddy_config(
  Path.t(),
  keyword()
) :: {:ok, String.t()}

Generates a Caddy config serving the tree at out as a read-only /v2 registry.

nginx_config(out, opts \\ [])

@spec nginx_config(
  Path.t(),
  keyword()
) :: {:ok, String.t()}

Generates an nginx config serving the tree at out as a read-only /v2 registry.

tree(source, out, opts \\ [])

@spec tree(String.t(), Path.t(), keyword()) :: {:ok, headers()} | {:error, term()}

Copies source into a static registry tree at out and returns the manifest header map.

opts: :name (repository; derived from a registry source otherwise), and any Stevedore.copy/3 option (:all, :platform, :scheme, :creds).