Skip to content

feature/shared base runtime image#91

Merged
phlisg merged 10 commits into
developfrom
feature/shared-base-runtime-image
Jun 25, 2026
Merged

feature/shared base runtime image#91
phlisg merged 10 commits into
developfrom
feature/shared-base-runtime-image

Conversation

@phlisg

@phlisg phlisg commented Jun 25, 2026

Copy link
Copy Markdown
Owner
  • feat(runtime): split frankenphp Dockerfile into base + thin templates
  • feat(runtime): split fpm Dockerfile into base + thin templates
  • feat(baseimage): add base image tag derivation + render + hash helper
  • feat(eject): flatten .frank/Dockerfile to self-contained form on eject
  • feat(generate): emit .frank/base.Dockerfile alongside thin .frank/Dockerfile
  • feat(baseimage): add ensure-base helper (inspect, label-compare, flock, build, prune)
  • feat(cmd): ensure shared base image before every managed compose build
  • feat(up): migrate pre-split projects + track base.Dockerfile staleness
  • test(golden): regenerate fixtures for base + thin Dockerfile split
  • fix(baseimage): stream base build progress + trim verbose copy

phlisg added 10 commits June 25, 2026 13:51
base holds project-invariant layers (built once, shared per tuple); thin is
FROM frank/runtime:<tag> + Caddyfile COPY. Enables shared-base image dedup.
base holds the full fpm invariant set; thin is FROM frank/runtime:<tag> only
(fpm has no project-specific layers). nginx image untouched.
Tag encodes php+runtime+node+pg so distinct tuples never clobber; sha256 of
the rendered base Dockerfile (frank.base.hash) catches template-body drift
within a tuple. Foundation for ensure-base staleness checks.
Ejected projects hand off to Sail, which can't rebuild FROM frank/runtime.
eject now rewrites .frank/Dockerfile to the monolithic pre-split form (no
FROM frank/runtime). frank down stays --rmi-free so the shared base survives.
…kerfile

generate now writes both the shared base Dockerfile (project-invariant) and
the thin FROM-base Dockerfile, for both runtimes. One baseimage.Render call
selects the template by cfg.PHP.Runtime. Thin build context stays the project
root so worker/migrate build-block dedup is unaffected.
…k, build, prune)

Renders+hashes the base Dockerfile, inspects the tag's frank.base.hash label,
and rebuilds under a host flock (empty-context build from stdin) only when
absent or drifted. Prunes the prior dangling base best-effort. Lets every
project share one base built once per tuple.
frank up/new, frank compose <build|up|run|create>, and worker launch now
build/refresh frank/runtime:<tag> before compose so the thin FROM-base image
never triggers a docker.io pull. Raw dc aliases bypass Frank (documented).
autoRegenerate now treats a missing .frank/base.Dockerfile as a structural
staleness trigger (pre-split self-migration), and dockerfileChanged watches
base.Dockerfile(.tmpl) so editing the base template forces a rebuild.
Each fixture now carries .frank/base.Dockerfile (invariant build layers) and a
thin .frank/Dockerfile (FROM frank/runtime:<tag>). Add base.Dockerfile to the
generate_test fixture file lists so -update tracks it.

Update template_test: the thin Dockerfile.tmpl is now just a FROM line, so the
invariant assertions move to new base.Dockerfile tests; thin tests now assert
the FROM frank/runtime:<tag> form matching baseimage.Tag.

Also fix SA4006 in baseimage/ensure.go: the pre-lock inspectBase oldID was
overwritten unread before use; discard it and capture oldID under the lock,
where the post-build prune actually consumes it.

Restores green test suite + pre-commit hook (no --no-verify needed).
Base build now renders through a LiveRegion (live docker build output, tick
on done) instead of a silent spinner — a 2GB first build is no longer opaque.
Drops the "(once, shared by all projects)" and "(pre-split project)" noise.
@phlisg phlisg merged commit 92c67bf into develop Jun 25, 2026
1 check passed
@phlisg phlisg deleted the feature/shared-base-runtime-image branch June 25, 2026 14:00
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