feature/shared base runtime image#91
Merged
Merged
Conversation
phlisg
commented
Jun 25, 2026
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.