-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add FrankenPHP variant for Drupal base images #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| # Enable FrankenPHP | ||
| frankenphp | ||
| order php_server before file_server | ||
| } | ||
|
|
||
| :80 { | ||
| # Enable compression | ||
| encode zstd gzip | ||
|
|
||
| # Set the root to the web directory where index.php lives | ||
| root * /app/web | ||
|
|
||
| # execute PHP files | ||
| php_server | ||
|
|
||
| file_server | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| ARG PHP_VERSION=8.4 | ||
| FROM dunglas/frankenphp:php${PHP_VERSION}-trixie | ||
|
|
||
| # install the PHP extensions we need | ||
| RUN set -eux; \ | ||
| apt-get update; \ | ||
| apt-get install -y --no-install-recommends \ | ||
| git \ | ||
| unzip \ | ||
| sendmail \ | ||
| mariadb-client \ | ||
| ; \ | ||
| \ | ||
| savedAptMark="$(apt-mark showmanual)"; \ | ||
| \ | ||
| apt-get update; \ | ||
| apt-get install -y --no-install-recommends \ | ||
| libavif-dev \ | ||
| libbz2-dev \ | ||
| libfreetype6-dev \ | ||
| libicu-dev \ | ||
| libjpeg-dev \ | ||
| libmemcached-dev \ | ||
| libpng-dev \ | ||
| libpq-dev \ | ||
| libwebp-dev \ | ||
| libyaml-dev \ | ||
| libzip-dev \ | ||
| ; \ | ||
| \ | ||
| docker-php-ext-configure gd \ | ||
| --with-avif \ | ||
| --with-freetype \ | ||
| --with-jpeg=/usr \ | ||
| --with-webp \ | ||
| ; \ | ||
| \ | ||
| # Extract PHP major.minor version from PHP_VERSION | ||
| PHP_MAJOR_MINOR=$(echo "${PHP_VERSION}" | cut -d'-' -f1); \ | ||
| # Opcache is bundled in PHP 8.5+, so only install it for earlier versions | ||
| case "$PHP_MAJOR_MINOR" in \ | ||
| 8.[5-9]*|[9-9]*.*) \ | ||
| OPCACHE_EXT="" ;; \ | ||
| *) \ | ||
| OPCACHE_EXT="opcache" ;; \ | ||
| esac; \ | ||
| \ | ||
| docker-php-ext-install -j "$(nproc)" \ | ||
| bcmath \ | ||
| bz2 \ | ||
| exif \ | ||
| gd \ | ||
| intl \ | ||
| $OPCACHE_EXT \ | ||
| pcntl \ | ||
| pdo_mysql \ | ||
| pdo_pgsql \ | ||
| sockets \ | ||
| zip \ | ||
| ; \ | ||
| \ | ||
| pecl install \ | ||
| apcu \ | ||
| memcached \ | ||
| redis \ | ||
| yaml \ | ||
| ; \ | ||
| \ | ||
| docker-php-ext-enable \ | ||
| apcu \ | ||
| memcached \ | ||
| redis \ | ||
| yaml \ | ||
| ; \ | ||
| \ | ||
| # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies | ||
| apt-mark auto '.*' > /dev/null; \ | ||
| apt-mark manual $savedAptMark; \ | ||
| ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ | ||
| | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \ | ||
| | sort -u \ | ||
| | xargs -r dpkg-query -S \ | ||
| | cut -d: -f1 \ | ||
| | sort -u \ | ||
| | xargs -rt apt-mark manual; \ | ||
| \ | ||
| apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # set recommended PHP.ini settings | ||
| # see https://secure.php.net/manual/en/opcache.installation.php | ||
| RUN { \ | ||
| echo 'opcache.memory_consumption=128'; \ | ||
| echo 'opcache.interned_strings_buffer=8'; \ | ||
| echo 'opcache.max_accelerated_files=4000'; \ | ||
| echo 'opcache.revalidate_freq=60'; \ | ||
| } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \ | ||
| # Remove the memory limit for the CLI only. | ||
| echo 'memory_limit = -1' > /usr/local/etc/php/php-cli.ini | ||
|
|
||
| # https://www.drupal.org/node/3298550 | ||
| # Drupal now recommends sites enable PHP output buffering by default | ||
| RUN { \ | ||
| echo 'output_buffering=true'; \ | ||
| } > /usr/local/etc/php/conf.d/docker-php-drupal-recommended.ini | ||
|
|
||
| # Install Composer | ||
| ENV COMPOSER_ALLOW_SUPERUSER=1 | ||
| COPY --from=composer:2 /usr/bin/composer /usr/local/bin/ | ||
|
|
||
| # FrankenPHP configuration | ||
| # Copy Caddyfile for Drupal configuration | ||
| COPY Caddyfile /etc/caddy/Caddyfile | ||
|
|
||
| WORKDIR /app | ||
| ENV PATH=${PATH}:/app/vendor/bin |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 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:
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-trixiedoes exist on Docker Hub (library/php). Its current image digest shown by Docker Hub issha256: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/frankenphptags for Debian Trixie follow this pattern:dunglas/frankenphp:<frankenphp-version>-php<php-version>-trixie(and similarly forbuilderimages). [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
phpimage (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
🌐 Web query:
Docker Hub dunglas frankenphp tags php8.4-trixie php8.5-trixie availability💡 Result:
On
dunglas/frankenphp, the tags are not published as plainphp8.x-trixie.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]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]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-trixieis published on Docker Hub (officiallibrary/php). Its tag exists (see the Hub “Image Layer Details” page forphp: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 asarm64v8/phpcorresponding 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 existFrankenPHP 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