Skip to content

Containers surface: contract types, config awareness, skopeo image plumbing#3

Open
horner wants to merge 5 commits into
mainfrom
feature/containers-surface
Open

Containers surface: contract types, config awareness, skopeo image plumbing#3
horner wants to merge 5 commits into
mainfrom
feature/containers-surface

Conversation

@horner

@horner horner commented Jul 21, 2026

Copy link
Copy Markdown
Member

Reserves Cloudflare Containers as a portable surface of the @mieweb/cloud contract and lands the cheap milestones (M0–M2 + the M3 sketch) from container-plan.md. The expensive part — an off-Cloudflare container runtime (M4) — is deliberately deferred until a real consumer app needs it.

What's in here

  • Plan (container-plan.md): milestones with checkboxes, the skopeo/Harbor image pipeline, proposed CLI UX, and the myapp (LibreOffice doc-conversion) walkthrough.
  • M0 — contract types (@mieweb/cloud-types): CloudContainerNamespace / CloudContainerStub aliases (a container binding is a DO namespace), primitive-table row, README binding tables + a Containers section with the per-target support matrix.
  • M1 — config awareness: schema gains a reserved docker driver and a per-target registry block (Harbor for mieweb); config.mjs parses wrangler's containers array into containerBindings; the host harness auto-wires container-backed DO bindings to UnsupportedBindingErrorboot cleanly, throw on first use with a hint (same pattern as Vectorize/AI). createUnsupportedBinding gains an optional hint param.
  • M2 — skopeo plumbing (packages/cli/src/images.mjs): mieweb images build|push|inspect|status — build once with buildah (docker fallback), skopeo copy to the target registry tagged <git sha> + latest, manifest digests pinned in .mieweb/images.lock.json; mieweb registry login|logout (authFile, password prompted — never argv/logged). On --target cloudflare, images push delegates to wrangler containers push. New packages/cli/README.md documents prerequisites and conventions.
  • M3 — sketch only: packages/test-app/forgejo-images.example.yml, the Forgejo Actions pipeline (buildah → skopeo → Harbor robot account) for consuming apps once the opensource-server cluster is up.

Behavior notes

  • Zero change on the cloudflare target — wrangler keeps handling containers natively.
  • No new runtime dependencies; skopeo/buildah are only required when the images/registry verbs are actually used.
  • Full workspace suite green (pnpm -r test); CLI error paths smoke-tested (missing registry, unknown container, no lockfile).

Not in this PR (tracked in container-plan.md)

  • Harbor URL/CA coordination with opensource-server (blocked on the cluster deploy).
  • M4: Docker-backed ctx.container adapter + conformance section.

horner added 5 commits July 17, 2026 08:36
CloudContainerNamespace/CloudContainerStub aliases (a container binding
is a DO namespace), header-table row, README binding tables + Containers
section with per-target support matrix.
- schema: 'docker' driver reserved + per-target registry block (Harbor)
- config.mjs: parse wrangler 'containers' array; expose containers +
  containerBindings (DO binding name -> container entry)
- host.mjs: container-backed DO bindings boot cleanly and throw
  UnsupportedBindingError on first use (with hint), instead of crashing
- createUnsupportedBinding gains optional hint param
- sample configs: commented reserved registry/driver shapes
- images.mjs: detectBuilder (buildah>docker), build, skopeo copy push
  (sha + latest tags), inspect, status; digest pins in
  .mieweb/images.lock.json
- registry login/logout via skopeo (authFile, password prompted, never argv)
- index.mjs: 'images'/'registry' verbs; cloudflare push delegates to
  'wrangler containers push'
- packages/cli README with Images section (prereqs, conventions, lockfile)
buildah build + skopeo copy to Harbor with a robot account, digest
lockfile bump committed by CI. Example only — runs in consuming apps
once the opensource-server cluster (Forgejo+Harbor) is up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant