Skip to content

Comments

feat: Add FrankenPHP variant for Drupal base images#22

Merged
hussainweb merged 2 commits intomainfrom
frankenphp
Jan 30, 2026
Merged

feat: Add FrankenPHP variant for Drupal base images#22
hussainweb merged 2 commits intomainfrom
frankenphp

Conversation

@hussainweb
Copy link
Owner

@hussainweb hussainweb commented Jan 30, 2026

This commit introduces a new FrankenPHP variant (frankenphp-trixie) for the Drupal base images.

Changes include:

  • Adding the frankenphp-trixie variant to the GitHub Actions workflow for building Docker images.
  • Updating the README to reflect the new variant and provide an example docker-compose.yml.
  • Modifying the build.sh script to include builds for the FrankenPHP variant.
  • Updating clean.sh to remove FrankenPHP related images.
  • Adding a Dockerfile and Caddyfile for the FrankenPHP variant.

Summary by CodeRabbit

  • New Features

    • Added FrankenPHP variant (frankenphp-trixie) with Caddy-based web server support for PHP 8.4 and 8.5.
    • Expanded Apache and Alpine/FPM image variants to cover PHP 8.2–8.5 across bookworm and trixie distributions.
  • Documentation

    • Updated available tags and supported PHP versions.
    • Added a FrankenPHP section with a docker-compose example for Drupal deployments.

✏️ Tip: You can customize this high-level summary in your review settings.

This commit introduces a new FrankenPHP variant (`frankenphp-trixie`) for the Drupal base images.

Changes include:
- Adding the `frankenphp-trixie` variant to the GitHub Actions workflow for building Docker images.
- Updating the README to reflect the new variant and provide an example `docker-compose.yml`.
- Modifying the `build.sh` script to include builds for the FrankenPHP variant.
- Updating `clean.sh` to remove FrankenPHP related images.
- Adding a `Dockerfile` and `Caddyfile` for the FrankenPHP variant.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

Introduces a frankenphp-trixie variant, refactors PHP_VERSION handling to separate version from distro suffixes across Dockerfiles and CI/build scripts, expands build matrix and build/clean scripts, and adds FrankenPHP documentation including a Caddy configuration and Drupal docker-compose example.

Changes

Cohort / File(s) Summary
CI & Build Scripts
.github/workflows/docker-buildx.yml, build.sh, clean.sh
Added frankenphp-trixie to build matrix; simplified PHP_VERSION build-arg to version-only; added pulls and buildx steps/tags for new variant combos.
Dockerfile PHP_VERSION refactor
php8/apache-bookworm/Dockerfile, php8/apache-trixie/Dockerfile, php8/fpm-alpine/Dockerfile
Changed ARG PHP_VERSION to plain version (e.g., 8.4) and appended distro/variant suffixes in FROM lines (e.g., -apache-bookworm, -apache-trixie, -fpm-alpine).
FrankenPHP variant files
php8/frankenphp-trixie/Dockerfile, php8/frankenphp-trixie/Caddyfile
New FrankenPHP Dockerfile (php8.4) installing many extensions, PECL packages, Composer, Drupal-oriented PHP config; added Caddyfile enabling FrankenPHP + static serving and compression.
Docs
README.md
Added frankenphp-trixie to available tags/variants, listed supported PHP versions for it, and added FrankenPHP section with Caddy example and docker-compose snippet for Drupal.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 In trixie fields I hop and sing,
New FrankenPHP bells ring-ding-ding,
Images stitched with careful art,
Extensions snug, each plays its part,
Compose and Caddy — joyful spring! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a FrankenPHP variant to Drupal base images, which is the primary objective reflected throughout the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch frankenphp

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
php8/apache-bookworm/Dockerfile (1)

45-46: ⚠️ Potential issue | 🟡 Minor

Stale comment - PHP_VERSION no longer contains variant suffix.

The comment references extracting version from "8.5-apache-bookworm", but PHP_VERSION is now just "8.4" (or similar) without the variant suffix. The cut command still works correctly (returns the input unchanged when no delimiter is found), but the comment is misleading.

📝 Suggested fix
-	# Extract PHP major.minor version from PHP_VERSION (e.g., "8.5" from "8.5-apache-bookworm")
+	# Extract PHP major.minor version from PHP_VERSION (e.g., "8.5")
php8/fpm-alpine/Dockerfile (1)

41-42: ⚠️ Potential issue | 🟡 Minor

Stale comment - PHP_VERSION no longer contains variant suffix.

Same issue as in apache-bookworm/Dockerfile: the comment references extracting from "8.5-fpm-alpine" but PHP_VERSION is now just the version number.

📝 Suggested fix
-	# Extract PHP major.minor version from PHP_VERSION (e.g., "8.5" from "8.5-fpm-alpine")
+	# Extract PHP major.minor version from PHP_VERSION (e.g., "8.5")
php8/apache-trixie/Dockerfile (1)

45-46: ⚠️ Potential issue | 🟡 Minor

Stale comment - PHP_VERSION no longer contains variant suffix.

Same issue as in other Dockerfiles: update the comment to reflect that PHP_VERSION is now just the version number.

📝 Suggested fix
-	# Extract PHP major.minor version from PHP_VERSION (e.g., "8.5" from "8.5-apache-trixie")
+	# Extract PHP major.minor version from PHP_VERSION (e.g., "8.5")
README.md (1)

7-24: ⚠️ Potential issue | 🟡 Minor

Clarify variant coverage (apache‑trixie + FrankenPHP versions).

Line 9-11 lists variants but omits apache-trixie, while Line 24 states all PHP versions exist in all variants, which conflicts with FrankenPHP being only 8.4/8.5 in this PR. Please tighten the wording to match the actual build matrix.

✏️ Suggested doc update
-This repository contains two main variants of the Drupal base image:
+This repository contains these variants of the Drupal base image:

 - `apache-bookworm`: Based on Debian Bookworm with Apache.
+- `apache-trixie`: Based on Debian Trixie with Apache.
 - `fpm-alpine`: Based on Alpine Linux with PHP-FPM.
-- `frankenphp-trixie`: Based on Debian Trixie with FrankenPHP (experimental).
+- `frankenphp-trixie`: Based on Debian Trixie with FrankenPHP (experimental; PHP 8.4–8.5 only).

-Each version is available in all variants (apache-bookworm, apache-trixie, fpm-alpine, frankenphp-trixie).
+Apache (bookworm/trixie) and FPM-Alpine are available for PHP 8.2–8.5. FrankenPHP is available for PHP 8.4–8.5.
🤖 Fix all issues with AI agents
In `@build.sh`:
- Around line 13-20: The two docker pull lines using invalid FrankenPHP tags
("dunglas/frankenphp:php8.4-trixie" and "dunglas/frankenphp:php8.5-trixie")
should be updated to use the proper FrankenPHP tag format (version prefix + php
version + os) or builder variants; replace those two tags with valid examples
like "dunglas/frankenphp:1.9.1-php8.4-trixie" and
"dunglas/frankenphp:1.9.1-php8.5-trixie" (or
"1.9.1-builder-php8.4-trixie"/"1.9.1-builder-php8.5-trixie") so the docker pull
commands succeed.

In `@php8/frankenphp-trixie/Dockerfile`:
- Around line 115-116: The PATH environment variable is pointing to the wrong
vendor directory: update the ENV PATH assignment so it appends /app/vendor/bin
instead of /app/web/vendor/bin; modify the Dockerfile's ENV PATH line (alongside
WORKDIR /app) to include /app/vendor/bin so Composer-installed binaries like
drush are available on the container PATH.
🧹 Nitpick comments (1)
clean.sh (1)

19-28: Consider adding explicit bookworm/trixie variant tags for drupal-base cleanup.

The script removes short tags (php8.2, php8.3, etc.) but doesn't remove the explicit variant tags like php8.2-apache-bookworm or php8.2-apache-trixie. If users want complete cleanup, these should be included.

♻️ Optional: Add explicit variant tag cleanup
 docker rmi hussainweb/drupal-base:php8.2
 docker rmi hussainweb/drupal-base:php8.3
 docker rmi hussainweb/drupal-base:php8.4
 docker rmi hussainweb/drupal-base:php8.5
+docker rmi hussainweb/drupal-base:php8.2-apache-bookworm
+docker rmi hussainweb/drupal-base:php8.3-apache-bookworm
+docker rmi hussainweb/drupal-base:php8.4-apache-bookworm
+docker rmi hussainweb/drupal-base:php8.5-apache-bookworm
+docker rmi hussainweb/drupal-base:php8.2-apache-trixie
+docker rmi hussainweb/drupal-base:php8.3-apache-trixie
+docker rmi hussainweb/drupal-base:php8.4-apache-trixie
+docker rmi hussainweb/drupal-base:php8.5-apache-trixie
+docker rmi hussainweb/drupal-base:php8.2-fpm-alpine
+docker rmi hussainweb/drupal-base:php8.3-fpm-alpine
+docker rmi hussainweb/drupal-base:php8.4-fpm-alpine
+docker rmi hussainweb/drupal-base:php8.5-fpm-alpine
 docker rmi hussainweb/drupal-base:php8.2-alpine

Comment on lines +13 to +20
docker pull php:8.4-apache-trixie
docker pull php:8.5-apache-trixie
docker pull php:8.2-fpm-alpine
docker pull php:8.3-fpm-alpine
docker pull php:8.4-fpm-alpine
docker pull php:8.5-fpm-alpine
docker pull dunglas/frankenphp:php8.4-trixie
docker pull dunglas/frankenphp:php8.5-trixie
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Docker Hub php official image php:8.4-apache-trixie tag manifest

💡 Result:

To see the manifest (multi-platform index) for php:8.4-apache-trixie, run one of these:

# Best (shows the manifest list digest + per-platform digests)
docker buildx imagetools inspect docker.io/library/php:8.4-apache-trixie

[1][2]

# Raw manifest JSON (OCI/Docker index)
docker buildx imagetools inspect --raw docker.io/library/php:8.4-apache-trixie

[2]

# Alternative (also supports --verbose)
docker manifest inspect docker.io/library/php:8.4-apache-trixie

[3][4]

These commands will show:

  • the top-level manifest list (index) digest for the tag, and
  • the platform-specific manifest digests (e.g., linux/amd64, linux/arm64, etc.). [1]

Sources
[1] https://docs.docker.com/dhi/core-concepts/digests/
[2] https://docs.docker.com/reference/cli/docker/buildx/imagetools/inspect/
[3] https://docs.docker.com/reference/cli/docker/manifest/inspect/
[4] https://docs.docker.com/reference/cli/docker/manifest/


🌐 Web query:

Docker Hub php official image php:8.5-apache-trixie tag

💡 Result:

The Docker Official Image php:8.5-apache-trixie does exist on Docker Hub (library/php). Its current image digest shown by Docker Hub is sha256:3183a16bdfaaef25d763b71f0d2d7d123a1db99fe590f789fbe9d21e07a5725d. [1]

Related version-pinned tag: php:8.5.0-apache-trixie (separate digest). [2]

-trixie” indicates the image is based on Debian Trixie. [3]

Pull: docker pull php:8.5-apache-trixie [1]

Sources: [1] [2] [3]


🌐 Web query:

Docker Hub dunglas frankenphp php8.4-trixie php8.5-trixie tags

💡 Result:

Docker Hub dunglas/frankenphp tags for Debian Trixie follow this pattern: dunglas/frankenphp:<frankenphp-version>-php<php-version>-trixie (and similarly for builder images). [1]

Examples of php8.4 + trixie tags seen on Docker Hub

  • builder-php8.4.15-trixie [2]
  • 1.9.1-builder-php8.4-trixie [3]
  • 1.11-builder-php8.4.16-trixie [4]

Examples of php8.5 + trixie tags seen for this repo

  • 1.9.1-php8.5-trixie [5]
  • 1.9.1-builder-php8.5-trixie [5]

Sources:
[1] (frankenphp.dev)
[2] (hub.docker.com)
[3] (hub.docker.com)
[4] (hub.docker.com)
[5] (newreleases.io)

Citations:


🌐 Web query:

Docker Hub official php image php:8.2-apache-trixie php:8.3-apache-trixie php:8.4-apache-trixie availability

💡 Result:

Yes—on Docker Hub’s official php image (library/php), the following tags are available:

  • php:8.2-apache-trixie (tag exists on library/php) [2]
  • php:8.3-apache-trixie (tag exists on library/php) [3]
  • php:8.4-apache-trixie (tag exists on library/php) [4]

These are part of the Docker Official Image for PHP on Docker Hub. [1]

Pull examples

docker pull php:8.2-apache-trixie
docker pull php:8.3-apache-trixie
docker pull php:8.4-apache-trixie

🌐 Web query:

Docker Hub dunglas frankenphp tags php8.4-trixie php8.5-trixie availability

💡 Result:

On dunglas/frankenphp, the tags are not published as plain php8.x-trixie.

  • The project documents the tag format as dunglas/frankenphp:<frankenphp-version>-php<php-version>-<os> (where <os> can be trixie). So you should expect tags like …-php8.4-trixie or …-php8.5-trixie, with a FrankenPHP version prefix. [1]
  • For PHP 8.4 + Trixie, Docker Hub clearly has tags such as 1.9.1-builder-php8.4-trixie (and other …php8.4…-trixie variants), confirming 8.4/Trixie images exist, just not under the plain php8.4-trixie tag name. [2]
  • The docs state that PHP 8.5 variants are provided as well, and trixie is a supported OS variant—so the expected stable tag naming would likewise be …-php8.5-trixie (with a FrankenPHP version prefix), not php8.5-trixie. [1]

So:

  • php8.4-trixie: not an expected/standard tag name for this repo; use * -php8.4-trixie with a FrankenPHP version prefix (or a builder tag like *-builder-php8.4-trixie). [1][2]
  • php8.5-trixie: same situation; look for * -php8.5-trixie with a FrankenPHP version prefix. [1]

Sources: [1] [2]


🌐 Web query:

Docker Hub php:8.5-apache-trixie linux/amd64 linux/arm64 multi-arch manifest

💡 Result:

php:8.5-apache-trixie is published on Docker Hub (official library/php). Its tag exists (see the Hub “Image Layer Details” page for php:8.5-apache-trixie). [1]

For multi-arch manifest verification (e.g., linux/amd64 + linux/arm64), the most reliable way is to inspect the manifest list locally:

docker buildx imagetools inspect php:8.5-apache-trixie
# or
docker manifest inspect php:8.5-apache-trixie

Note: Docker Hub’s web UI can sometimes fail to show all architectures even when the manifest is correct. [2]

Context: Docker Official Images (including php) are published as multi-architecture images, with per-architecture repos such as arm64v8/php corresponding to the arm64 builds of the same official image. [3]

Sources: [1] [2] [3]


Fix FrankenPHP tag naming in docker pull commands.

The PHP official images (php:8.2-apache-trixie, php:8.3-apache-trixie, php:8.4-apache-trixie, php:8.5-apache-trixie) are confirmed to exist with multi-architecture support (linux/amd64, linux/arm64, etc.). However, the FrankenPHP tags in lines 19–20 are incorrect:

  • dunglas/frankenphp:php8.4-trixie — does not exist
  • dunglas/frankenphp:php8.5-trixie — does not exist

FrankenPHP uses versioned tag naming: <version>-php<php-version>-<os> (e.g., 1.9.1-php8.4-trixie). Update these lines to use the correct tag format with a FrankenPHP version prefix, or use the builder variant tags (e.g., 1.9.1-builder-php8.4-trixie).

🤖 Prompt for AI Agents
In `@build.sh` around lines 13 - 20, The two docker pull lines using invalid
FrankenPHP tags ("dunglas/frankenphp:php8.4-trixie" and
"dunglas/frankenphp:php8.5-trixie") should be updated to use the proper
FrankenPHP tag format (version prefix + php version + os) or builder variants;
replace those two tags with valid examples like
"dunglas/frankenphp:1.9.1-php8.4-trixie" and
"dunglas/frankenphp:1.9.1-php8.5-trixie" (or
"1.9.1-builder-php8.4-trixie"/"1.9.1-builder-php8.5-trixie") so the docker pull
commands succeed.

Adds new docker image tags to the clean.sh script to ensure they are removed correctly.
Corrects the vendor directory path in the php8/frankenphp-trixie/Dockerfile to ensure the composer bin directory is correctly added to the PATH.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
clean.sh (1)

3-41: ⚠️ Potential issue | 🟡 Minor

Make cleanup resilient to missing images

docker rmi returns non‑zero when images are missing or in use, which can make the script exit with a failure status (especially if the last remove fails). Consider ignoring individual failures to keep cleanup robust in CI/local runs.

✅ Minimal change (apply to all `docker rmi` lines)
- docker rmi php:8.2-apache-bookworm
+ docker rmi php:8.2-apache-bookworm || true

@hussainweb hussainweb merged commit 43c1784 into main Jan 30, 2026
17 checks passed
@hussainweb hussainweb deleted the frankenphp branch January 30, 2026 18:31
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