Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/docker-buildx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
php_version: ["8.2", "8.3", "8.4", "8.5"]
variant: ["apache-trixie", "apache-bookworm", "fpm-alpine"]
variant: ["apache-trixie", "apache-bookworm", "fpm-alpine", "frankenphp-trixie"]
steps:
- name: Checkout
uses: actions/checkout@v6
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.tags.outputs.tags }}
build-args: |
PHP_VERSION=${{ matrix.php_version }}-${{ matrix.variant }}
PHP_VERSION=${{ matrix.php_version }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This repository contains two main variants of the Drupal base image:

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

Choose the image that best fits your needs. The Apache image is a good choice for a simple, all-in-one container, while the FPM image is ideal for use with a separate web server like Nginx.

Expand All @@ -20,7 +21,7 @@ This image supports the following PHP versions:
- PHP 8.4
- PHP 8.5 (latest)

Each version is available in all variants (apache-bookworm, apache-trixie, fpm-alpine).
Each version is available in all variants (apache-bookworm, apache-trixie, fpm-alpine, frankenphp-trixie).

### Available Tags

Expand All @@ -30,6 +31,7 @@ Each version is available in all variants (apache-bookworm, apache-trixie, fpm-a
- `php8.5-alpine`, `php8.5-fpm-alpine`, `latest-alpine` - PHP 8.5 FPM on Alpine Linux
- `php8.4`, `php8.3`, `php8.2` - Older PHP versions with Apache on Debian Trixie
- `php8.4-alpine`, `php8.3-alpine`, `php8.2-alpine` - Older PHP versions FPM on Alpine Linux
- `php8.5-frankenphp-trixie`, `php8.4-frankenphp-trixie` - FrankenPHP on Debian Trixie

All images support both `linux/amd64` and `linux/arm64` architectures.

Expand Down Expand Up @@ -98,3 +100,20 @@ server {
}
}
```

### FrankenPHP

The FrankenPHP image uses Caddy as the web server. It is configured to serve the Drupal site from `/app/web`.

Here is an example `docker-compose.yml` snippet:

```yaml
services:
drupal:
image: hussainweb/drupal-base:php8.4-frankenphp-trixie
volumes:
- ./path/to/your/drupal/root:/app/web
ports:
- "8080:80"
restart: always
```
29 changes: 21 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,34 @@ docker pull php:8.2-apache-bookworm
docker pull php:8.3-apache-bookworm
docker pull php:8.4-apache-bookworm
docker pull php:8.5-apache-bookworm
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
Comment on lines +13 to +20
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.

docker pull composer:2

docker buildx create --use --name drupal-base-builder

docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.2 --build-arg PHP_VERSION=8.2-apache-bookworm ${dir}/php8/apache-bookworm/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.3 --build-arg PHP_VERSION=8.3-apache-bookworm ${dir}/php8/apache-bookworm/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.4 --build-arg PHP_VERSION=8.4-apache-bookworm ${dir}/php8/apache-bookworm/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.5 --tag hussainweb/drupal-base:latest --build-arg PHP_VERSION=8.5-apache-bookworm ${dir}/php8/apache-bookworm/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.2-alpine --build-arg PHP_VERSION=8.2-fpm-alpine ${dir}/php8/fpm-alpine/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.3-alpine --build-arg PHP_VERSION=8.3-fpm-alpine ${dir}/php8/fpm-alpine/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.4-alpine --build-arg PHP_VERSION=8.4-fpm-alpine ${dir}/php8/fpm-alpine/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.5-alpine --tag hussainweb/drupal-base:latest-alpine --build-arg PHP_VERSION=8.5-fpm-alpine ${dir}/php8/fpm-alpine/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.2-apache-bookworm --build-arg PHP_VERSION=8.2 ${dir}/php8/apache-bookworm/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.3-apache-bookworm --build-arg PHP_VERSION=8.3 ${dir}/php8/apache-bookworm/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.4-apache-bookworm --build-arg PHP_VERSION=8.4 ${dir}/php8/apache-bookworm/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.5-apache-bookworm --build-arg PHP_VERSION=8.5 ${dir}/php8/apache-bookworm/

docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.2 --tag hussainweb/drupal-base:php8.2-apache-trixie --build-arg PHP_VERSION=8.2 ${dir}/php8/apache-trixie/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.3 --tag hussainweb/drupal-base:php8.3-apache-trixie --build-arg PHP_VERSION=8.3 ${dir}/php8/apache-trixie/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.4 --tag hussainweb/drupal-base:php8.4-apache-trixie --build-arg PHP_VERSION=8.4 ${dir}/php8/apache-trixie/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.5 --tag hussainweb/drupal-base:php8.5-apache-trixie --tag hussainweb/drupal-base:latest --build-arg PHP_VERSION=8.5 ${dir}/php8/apache-trixie/

docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.2-alpine --tag hussainweb/drupal-base:php8.2-fpm-alpine --build-arg PHP_VERSION=8.2 ${dir}/php8/fpm-alpine/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.3-alpine --tag hussainweb/drupal-base:php8.3-fpm-alpine --build-arg PHP_VERSION=8.3 ${dir}/php8/fpm-alpine/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.4-alpine --tag hussainweb/drupal-base:php8.4-fpm-alpine --build-arg PHP_VERSION=8.4 ${dir}/php8/fpm-alpine/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.5-alpine --tag hussainweb/drupal-base:php8.5-fpm-alpine --tag hussainweb/drupal-base:latest-alpine --build-arg PHP_VERSION=8.5 ${dir}/php8/fpm-alpine/

docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.4-frankenphp-trixie --build-arg PHP_VERSION=8.4 ${dir}/php8/frankenphp-trixie/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.5-frankenphp-trixie --build-arg PHP_VERSION=8.5 ${dir}/php8/frankenphp-trixie/

docker buildx rm drupal-base-builder
28 changes: 24 additions & 4 deletions clean.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#!/usr/bin/env bash

docker rmi php:8.2-apache-bullseye
docker rmi php:8.3-apache-bullseye
docker rmi php:8.4-apache-bullseye
docker rmi php:8.5-apache-bullseye
docker rmi php:8.2-apache-bookworm
docker rmi php:8.3-apache-bookworm
docker rmi php:8.4-apache-bookworm
docker rmi php:8.5-apache-bookworm
docker rmi php:8.2-apache-trixie
docker rmi php:8.3-apache-trixie
docker rmi php:8.4-apache-trixie
docker rmi php:8.5-apache-trixie
docker rmi php:8.2-fpm-alpine
docker rmi php:8.3-fpm-alpine
docker rmi php:8.4-fpm-alpine
docker rmi php:8.5-fpm-alpine
docker rmi dunglas/frankenphp:php8.4-trixie
docker rmi dunglas/frankenphp:php8.5-trixie
docker rmi composer:2

docker rmi hussainweb/drupal-base:php8.2
Expand All @@ -18,4 +24,18 @@ docker rmi hussainweb/drupal-base:php8.2-alpine
docker rmi hussainweb/drupal-base:php8.3-alpine
docker rmi hussainweb/drupal-base:php8.4-alpine
docker rmi hussainweb/drupal-base:php8.5-alpine
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.4-frankenphp-trixie
docker rmi hussainweb/drupal-base:php8.5-frankenphp-trixie
docker rmi hussainweb/drupal-base:latest
4 changes: 2 additions & 2 deletions php8/apache-bookworm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG PHP_VERSION=8.4-apache-bookworm
ARG PHP_VERSION=8.4
# from https://www.drupal.org/docs/system-requirements/php-requirements
FROM php:${PHP_VERSION}
FROM php:${PHP_VERSION}-apache-bookworm

# install the PHP extensions we need
RUN set -eux; \
Expand Down
4 changes: 2 additions & 2 deletions php8/apache-trixie/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG PHP_VERSION=8.4-apache-trixie
ARG PHP_VERSION=8.4
# from https://www.drupal.org/docs/system-requirements/php-requirements
FROM php:${PHP_VERSION}
FROM php:${PHP_VERSION}-apache-trixie

# install the PHP extensions we need
RUN set -eux; \
Expand Down
4 changes: 2 additions & 2 deletions php8/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG PHP_VERSION=8.4-fpm-alpine
ARG PHP_VERSION=8.4
# from https://www.drupal.org/docs/system-requirements/php-requirements
FROM php:${PHP_VERSION}
FROM php:${PHP_VERSION}-fpm-alpine

# install the PHP extensions we need
RUN set -eux; \
Expand Down
18 changes: 18 additions & 0 deletions php8/frankenphp-trixie/Caddyfile
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
}
116 changes: 116 additions & 0 deletions php8/frankenphp-trixie/Dockerfile
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