Skip to content

Build PHP and FrankenPHP from source - #34

Merged
clvsh merged 4 commits into
mainfrom
build/php-frankenphp-from-source
Nov 18, 2026
Merged

clvsh merged 4 commits into
mainfrom
build/php-frankenphp-from-source

Conversation

@clvsh

@clvsh clvsh commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

  • Compile PHP CLI and shared ZTS libphp from the same php.net release tarball. Verify SHA-256 and the official release signature.
  • Compile the released FrankenPHP/Caddy server from its exact Git commit using that libphp. Keep the existing Caddy modules, entrypoint, PHP extension tools, port binding, and Debian/variant/platform tags.
  • Resolve source releases once per CI run using Bash, curl and jq; no Python dependency. The daily production planner compares published source-version labels, so new PHP and FrankenPHP releases no longer wait on upstream Docker images.
  • Check exact resolved versions, ZTS and extensions in both the PHP CLI and a live FrankenPHP HTTP request.

Debian, Go, Node and Composer images remain dependencies; PHP/FrankenPHP upstream images do not. Full matrix builds and smoke tests are gated by the pull request workflow. No changes to image publication authorization.

Verification

  • bash .github/scripts/test-source-build.sh: ten resolver/planner regression scenarios passed.
  • Verified the PHP runtime package parser ignores Trixie usrmerge diversion records.
  • Live release resolution and Buildx Bake override render: eight targets, two platforms each; PHP 8.4.27/8.5.12 and FrankenPHP v1.13.5.
  • Verified the exact FrankenPHP commit fetch, per-platform published image config lookup, shell/PHP syntax and git diff --check.
  • Full container builds and runtime smoke tests require GitHub Actions; no Docker daemon on the local executor.

Summary by CodeRabbit

  • New Features
    • Added a local development build option.
    • Production images now include PHP and FrankenPHP built from stable source releases.
  • Improvements
    • Scheduled refreshes now account for PHP and FrankenPHP source updates and Debian package upgrades.
    • Image checks now verify PHP and FrankenPHP versions and runtime behavior.
  • Documentation
    • Updated build instructions and supported release details.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The pull request replaces the inherited FrankenPHP image with a multi-stage build of PHP and FrankenPHP from source. It adds release resolution, integrates resolved versions into CI and scheduled build planning, and adds runtime checks for the built image.

Changes: Source-built PHP and FrankenPHP

Layer / File(s) Summary
Resolve source versions and configure builds
docker/resolve-sources.sh, docker-bake.hcl, docker/build-local.sh, README.md, AGENTS.md
The resolver validates PHP release versions and checksums, and resolves a stable FrankenPHP release to a commit. Bake targets and local build instructions use the resolved source values.
Build and assemble the source runtime
docker/build-php.sh, docker/build-frankenphp.sh, docker/php-helpers/*, Dockerfile, docker/docker-php-entrypoint
The build compiles PHP and FrankenPHP from source and stages their runtime artifacts. The Dockerfile assembles the runtime image and uses the added PHP extension helpers.
Wire source builds into CI and scheduled planning
.github/workflows/pipeline.yml, .github/scripts/plan-scheduled-build.sh, .github/scripts/test-source-build.sh, README.md
CI resolves source versions, shares them with build jobs, and checks scheduled rebuilds against image source-version labels. Offline tests cover source resolution, label comparisons, and package-update results.
Validate built image versions and runtime behavior
.github/workflows/pipeline.yml, test.php
The image test receives expected PHP and FrankenPHP versions from matrix metadata. Runtime checks validate those versions, PHP thread safety, HTTP-served runtime details, and environment-specific extensions.

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Refactor

Sequence Diagram(s)

sequenceDiagram
  participant Pipeline as CI pipeline
  participant Resolver as resolve-sources.sh
  participant Bake as Docker Bake
  participant Image as Built image
  participant Tests as Image tests
  Pipeline->>Resolver: Resolve source versions from Bake metadata
  Resolver-->>Pipeline: Return source-version override
  Pipeline->>Bake: Build with Bake configuration and override
  Bake-->>Image: Produce image
  Pipeline->>Tests: Pass expected PHP and FrankenPHP versions
  Tests->>Image: Check versions and runtime behavior
Loading

Suggested reviewers: clovis-mo

Merge Risk: Minimal · up to 65822

This change builds PHP and FrankenPHP from verified source releases instead of inheriting the upstream image, and it updates CI planning to match. No concrete defect was found in review. Container build and runtime checks run in the pull request workflow, so merge once those pass.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Build PHP and FrankenPHP from source" matches the main change: the PR replaces upstream FrankenPHP-based images with source builds of PHP (CLI and shared ZTS libphp) and FrankenPHP. The cha…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Build PHP and FrankenPHP from source" matches the main change: the PR replaces upstream FrankenPHP-based images with source builds of PHP (CLI and shared ZTS libphp) and FrankenPHP. The changeset covers the Dockerfile, build scripts (build-php.sh, build-frankenphp.sh), source resolution, and planner updates, all of which support this title. The title is concise, specific, and clear for a teammate scanning history.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: 50b40348-988c-40f2-8bc3-81eb6c31a900
Commits

Reviewing files that changed from the base of the PR and between 0cc1e18 and 658221d.

Files selected for processing: 19

  • .github/scripts/plan-scheduled-build.sh
  • .github/scripts/test-source-build.sh
  • .github/workflows/pipeline.yml
  • AGENTS.md
  • Dockerfile
  • README.md
  • docker-bake.hcl
  • docker/build-frankenphp.sh
  • docker/build-local.sh
  • docker/build-php.sh
  • docker/docker-php-entrypoint
  • docker/php-helpers/LICENSE
  • docker/php-helpers/README.md
  • docker/php-helpers/docker-php-ext-configure
  • docker/php-helpers/docker-php-ext-enable
  • docker/php-helpers/docker-php-ext-install
  • docker/php-helpers/docker-php-source
  • docker/resolve-sources.sh
  • test.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@clvsh
clvsh marked this pull request as ready for review November 18, 2026 22:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T22:04:14.887457Z 658221d Draft marked ready
🔒 Security Review ✅ Completed 2026-11-18T22:06:56.962702Z 658221d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clvsh
clvsh merged commit dd717f8 into main Nov 18, 2026
35 checks passed
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