feat: Add FrankenPHP variant for Drupal base images#22
Conversation
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.
📝 WalkthroughWalkthroughIntroduces 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 | 🟡 MinorStale comment - PHP_VERSION no longer contains variant suffix.
The comment references extracting version from
"8.5-apache-bookworm", butPHP_VERSIONis now just"8.4"(or similar) without the variant suffix. Thecutcommand 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 | 🟡 MinorStale comment - PHP_VERSION no longer contains variant suffix.
Same issue as in
apache-bookworm/Dockerfile: the comment references extracting from"8.5-fpm-alpine"butPHP_VERSIONis 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 | 🟡 MinorStale comment - PHP_VERSION no longer contains variant suffix.
Same issue as in other Dockerfiles: update the comment to reflect that
PHP_VERSIONis 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 | 🟡 MinorClarify 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 likephp8.2-apache-bookwormorphp8.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
| 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 |
There was a problem hiding this comment.
🧩 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:
- 1: https://frankenphp.dev/docs/docker/?utm_source=openai
- 2: https://hub.docker.com/layers/dunglas/frankenphp/builder-php8.4.15-trixie/images/sha256-d0eec9cb5a236e4e79442c32f7927add80f9b6c8fbff8412afbbf6be65528e0b?utm_source=openai
- 3: https://hub.docker.com/layers/dunglas/frankenphp/1.9.1-builder-php8.4-trixie/images/sha256-875145ea0fdc72a40ed3f95692776ebca1ceff1af0e58cd25425c85ebc474af2?utm_source=openai
- 4: https://hub.docker.com/layers/dunglas/frankenphp/1.11-builder-php8.4.16-trixie/images/sha256-4e9f3ebfd6bf0c20dc6193445e4da88be3e545a35f0c57067ae29012baff435d?utm_source=openai
- 5: https://newreleases.io/latest?start=amf3rfr&utm_source=openai
🌐 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 onlibrary/php) [2]php:8.3-apache-trixie(tag exists onlibrary/php) [3]php:8.4-apache-trixie(tag exists onlibrary/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 betrixie). So you should expect tags like…-php8.4-trixieor…-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…-trixievariants), confirming 8.4/Trixie images exist, just not under the plainphp8.4-trixietag name. [2] - The docs state that PHP 8.5 variants are provided as well, and
trixieis a supported OS variant—so the expected stable tag naming would likewise be…-php8.5-trixie(with a FrankenPHP version prefix), notphp8.5-trixie. [1]
So:
php8.4-trixie: not an expected/standard tag name for this repo; use* -php8.4-trixiewith a FrankenPHP version prefix (or a builder tag like*-builder-php8.4-trixie). [1][2]php8.5-trixie: same situation; look for* -php8.5-trixiewith 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-trixieNote: 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 existdunglas/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.
There was a problem hiding this comment.
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 | 🟡 MinorMake cleanup resilient to missing images
docker rmireturns 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
This commit introduces a new FrankenPHP variant (
frankenphp-trixie) for the Drupal base images.Changes include:
frankenphp-trixievariant to the GitHub Actions workflow for building Docker images.docker-compose.yml.build.shscript to include builds for the FrankenPHP variant.clean.shto remove FrankenPHP related images.DockerfileandCaddyfilefor the FrankenPHP variant.Summary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.