Skip to content

docs: Plan H — per-layer ZFS clone chain for daemon URIs (dockerd://, podman://)#20

Open
sodre wants to merge 2 commits intozenroot/mainfrom
feature/zfs-h-plan
Open

docs: Plan H — per-layer ZFS clone chain for daemon URIs (dockerd://, podman://)#20
sodre wants to merge 2 commits intozenroot/mainfrom
feature/zfs-h-plan

Conversation

@sodre
Copy link
Copy Markdown
Member

@sodre sodre commented May 6, 2026

Follow-up to #17 (Plan G). Adds the implementation plan for extending chain mode (ENROOT_ZFS_LAYER_CHAIN=y) to daemon-local image URIs.

Why a follow-up plan

Plan G (#17) only handles docker:// URIs because they go through docker::_prepare_layers which produces the per-layer directories the chain installer needs. The daemon path (dockerd://, podman://) uses ${engine} export | tar -x — a flatten operation that drops layer information, so chain mode is silently a no-op for daemon URIs today.

Plan H bridges that gap by switching the daemon path's extraction from ${engine} export to ${engine} save (which preserves per-layer tarballs in a tar archive plus a manifest.json describing layer order), then routing through Plan G's existing _install_layer_chain.

Tradeoffs spelled out in the plan

  • Disk pressure: ${engine} save | tar -x dumps each layer's layer.tar to disk before extraction, so peak disk is ~1× the merged image size. Today's flat-export streams in a single pass with effectively no intermediate.
  • No cross-source dedup: a layer pulled via docker://alpine and the same layer extracted via dockerd://alpine produce different .layers/<digest> datasets — the registry blob is gzip/zstd-compressed and docker save's layer.tar is uncompressed, so the sha256s differ. Within-source dedup (multiple daemon images that share a base) still works.
  • Engine compatibility: Docker Image Format v1.1+ only. OCI archive format (podman save --format oci-archive) is not in scope.

What lands in this PR

Plan markdown only — doc/plans/2026-05-06-zfs-h-daemon-chain.md. The implementation references Plan G's _install_layer_chain / _apply_layer_payload / _build_layer helpers, so this plan is unblocked once Plan G (#17) merges.

Status

Draft — not for merge yet. Plan G (#17) should land first. The README/zfs.md cross-references will follow when both have landed.

🤖 Generated with Claude Code

sodre added 2 commits May 6, 2026 08:18
Plan H extends Plan G's per-layer zfs clone chain to dockerd:// and
podman:// URIs via \`${engine} save\` (preserves per-layer tarballs +
manifest.json describing layer order) instead of \`${engine} export\`
(flattens). Layer digests are content-addressed via sha256 of each
layer.tar, so the same image won't share .layers/ datasets across
docker:// and dockerd:// sources (registry blobs are compressed; save's
layer.tar is uncompressed — same content, different sha) but multiple
local daemon images with shared base layers DO dedup at the .layers/
level.

Default-off — flag unset leaves the existing flat-export daemon path
byte-for-byte unchanged. Same dispatch shape as Plan G (chain-mode
gate on ENROOT_ZFS_LAYER_CHAIN=y, branched in import_daemon_pointer
and create_from_pointer's recovery arm).

Plan-doc only — depends on Plan G's helpers, which land in PR #17.
The doc/plans/README.md index and doc/zfs.md knob description will
follow when both Plan G and Plan H land on zenroot/main.

Signed-off-by: Patrick Sodré <patrick@zero-ae.com>
Signed-off-by: Patrick Sodré <patrick@zero-ae.com>
@sodre sodre marked this pull request as ready for review May 6, 2026 12:19
@sodre sodre force-pushed the feature/zfs-h-plan branch from aac6717 to b5e814e Compare May 6, 2026 12:19
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