Skip to content
Open
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
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This repository builds the `ghcr.io/prvious/frankenphp` development and producti

## Build, Test, and Development Commands

- `docker buildx bake --print` inspects the default PHP 8.4/8.5 minor-version matrix. Override `PHP_VERSION`, `LATEST`, `SHA`, and `REFRESH` when testing matrix or dependency-refresh changes.
- `docker buildx bake --print` inspects the default PHP 8.4/8.5/8.6 minor-version matrix. Override `PHP_VERSION`, `LATEST`, `SHA`, and `REFRESH` when testing matrix or dependency-refresh changes.
- `docker buildx bake --print | bash docker/resolve-sources.sh > /tmp/frankenphp-sources.json` resolves the stable source versions for the matrix.
- `docker buildx bake -f docker-bake.hcl -f /tmp/frankenphp-sources.json` builds all configured variants and architectures. See README for loading one target locally.
- `bash .github/scripts/test-source-build.sh` tests source resolution and scheduled rebuild planning without a Docker daemon.
Expand Down
38 changes: 32 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -168,25 +168,47 @@ RUN curl --retry 3 -fsSL \
https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions \
-o /usr/local/bin/install-php-extensions \
&& chmod 0755 /usr/local/bin/install-php-extensions \
&& external_extensions=(imagick imap) \
&& if [[ "${PHP_VERSION}" == 8.6.* ]]; then \
external_extensions=( \
Imagick/imagick@b580a705e2c879924bfaee2e1ed3a93c9cb3fcfb \
php/pecl-mail-imap@c441c79add125f5a01f88332805221edeebe47b0 \
); \
fi \
&& install-php-extensions \
mysqli \
pdo_mysql \
pgsql \
pdo_pgsql \
bcmath \
gd \
imagick \
imap \
"${external_extensions[@]}" \
pcntl \
zip \
intl \
exif \
ftp \
xml \
pdo_sqlsrv \
sqlsrv \
sockets

# PHP 8.6-compatible SQL Server drivers are published through PIE.
RUN --mount=type=bind,from=ghcr.io/php/pie:1-bin,source=/pie,target=/usr/local/bin/pie \
if [[ "${PHP_VERSION}" == 8.6.* ]]; then \
. /etc/os-release \
&& curl --retry 3 -fsSL "https://packages.microsoft.com/config/debian/${VERSION_ID}/packages-microsoft-prod.deb" -o /tmp/packages-microsoft-prod.deb \
&& dpkg -i /tmp/packages-microsoft-prod.deb \
&& apt-get update \
&& ACCEPT_EULA=Y apt-get install -y --no-install-recommends msodbcsql18 unixodbc-dev \
&& export XDG_CONFIG_HOME=/tmp/pie-config XDG_CACHE_HOME=/tmp/pie-cache \
&& pie install --no-interaction microsoft/sqlsrv \
&& pie install --no-interaction microsoft/pdo_sqlsrv \
Comment thread
pullfrog[bot] marked this conversation as resolved.
Resolved
&& apt-get purge -y --auto-remove unixodbc-dev \
&& apt-get clean \
&& rm -rf /tmp/pie-config /tmp/pie-cache /tmp/packages-microsoft-prod.deb /var/lib/apt/lists/*; \
else \
install-php-extensions pdo_sqlsrv sqlsrv; \
fi

# Copy runtime configuration and major-channel artifacts after the expensive package layers.
# --link makes each layer independent of the ones below it, so a refresh of the
# package layers keeps these (Node alone is 51 MB compressed) and nodes that run
Expand Down Expand Up @@ -281,8 +303,12 @@ RUN echo "${REFRESH}" > /dev/null \
&& apt-get clean \
&& rm -rf /tmp/fzf /var/lib/apt/lists/*

# Development PHP extensions
RUN install-php-extensions xdebug \
# PHP 8.6 needs the Xdebug 3.6 prerelease until a compatible stable release is available.
RUN if [[ "${PHP_VERSION}" == 8.6.* ]]; then \
install-php-extensions xdebug/xdebug@3.6.0alpha1; \
else \
install-php-extensions xdebug; \
fi \
&& cp "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

# Copy development shell configuration
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Custom [FrankenPHP](https://frankenphp.dev) Docker images with batteries include

```bash
# Development (includes xdebug, dev tools)
docker pull ghcr.io/prvious/frankenphp:php8.5-dev
docker pull ghcr.io/prvious/frankenphp:php8.6-dev

# Production
docker pull ghcr.io/prvious/frankenphp:php8.5
docker pull ghcr.io/prvious/frankenphp:php8.6
```

## What's Included
Expand All @@ -26,7 +26,7 @@ docker pull ghcr.io/prvious/frankenphp:php8.5

### Dev Only

- **PHP**: Xdebug
- **PHP**: Xdebug (3.6 prerelease on PHP 8.6)
- **Tools**: GitHub CLI, OpenCode, htop, nano, fzf, zoxide, eza
- **Shell**: Oh My Zsh, Starship prompt, syntax highlighting, autosuggestions, fzf-tab

Expand All @@ -36,22 +36,24 @@ The entries below illustrate the configured PHP minor tag format:

| Tag | Description |
|-----|-------------|
| `php8.6` | PHP 8.6 production |
| `php8.6-dev` | PHP 8.6 development |
| `php8.5` | PHP 8.5 production |
| `php8.5-dev` | PHP 8.5 development |
| `php8.4` | PHP 8.4 production |
| `php8.4-dev` | PHP 8.4 development |
| `latest` | Latest supported PHP production |
| `latest-dev` | Latest supported PHP development |

The workflow publishes the latest stable PHP patch in each configured minor line (8.4 and 8.5) and the latest stable FrankenPHP release. PHP and FrankenPHP are compiled from source; neither official image is used. Unqualified tags use Debian Trixie. For Debian Bookworm, insert `-bookworm` before the optional `-dev` suffix: `php8.5-bookworm`, `php8.5-bookworm-dev`, `latest-bookworm`, or `latest-bookworm-dev`. All images support `linux/amd64` and `linux/arm64`.
The workflow compiles the latest stable PHP patch in each configured minor line (8.4, 8.5, and 8.6) and the latest stable FrankenPHP release. The `latest` and `php8` aliases use PHP 8.6. Unqualified tags use Debian Trixie. For Debian Bookworm, use tags such as `php8.6-bookworm` or `php8.6-bookworm-dev`. All images support `linux/amd64` and `linux/arm64`.

## Usage with Laravel

```yaml
# docker-compose.yml
services:
app:
image: ghcr.io/prvious/frankenphp:php8.5-dev
image: ghcr.io/prvious/frankenphp:php8.6-dev
ports:
- "80:80"
- "443:443"
Expand Down
6 changes: 3 additions & 3 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ variable "IMAGE_NAME" {
}

variable "PHP_VERSION" {
description = "Comma-separated list of PHP minor versions to build, e.g. '8.4,8.5'."
default = "8.4,8.5"
description = "Comma-separated list of PHP minor versions to build, e.g. '8.4,8.5,8.6'."
default = "8.4,8.5,8.6"
}

variable "SHA" {
Expand All @@ -14,7 +14,7 @@ variable "SHA" {

variable "LATEST" {
description = "The PHP minor version to publish under the latest aliases."
default = "8.5"
default = "8.6"
}

variable "REFRESH" {
Expand Down
14 changes: 10 additions & 4 deletions docker/build-php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ case "$PHP_MINOR" in
8.5)
keys=(1198C0117593497A5EC5C199286AF1F9897469DC 49D9AF6BC72A80D6691719C8AA23F5BE9C7097D4 D95C03BC702BE9515344AE3374E44BC9067701A5)
;;
8.6)
keys=(D95C03BC702BE9515344AE3374E44BC9067701A5 016895DE9A475111D537A6E69134FF30BC5A99B5 5CFF17B64DC1C244F5D0EAC3E43535E2EB19010E)
;;
*)
echo "No release signing keys configured for PHP_MINOR=${PHP_MINOR}." >&2
exit 1
Expand Down Expand Up @@ -53,9 +56,13 @@ multiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"
# Match the PHP ZTS image's core extension set, ini locations and toolchain
# interface so existing PHP configuration and downstream extension builds work.
# OPcache is shared in PHP 8.4 and built in from PHP 8.5.
opcache=()
options=()
if [[ "$PHP_MINOR" == 8.4 ]]; then
opcache=(--enable-opcache=shared)
options+=(--enable-opcache=shared)
fi
# PHP 8.6 uses local-exec TLS for executables and PIC for shared libraries.
if [[ "$PHP_MINOR" == 8.4 || "$PHP_MINOR" == 8.5 ]]; then
options+=(--with-pic)
fi

./configure \
Expand All @@ -67,7 +74,6 @@ fi
--enable-zts \
--enable-embed=shared \
--disable-zend-signals \
--with-pic \
--with-mhash \
--enable-mbstring \
--enable-mysqlnd \
Expand All @@ -84,7 +90,7 @@ fi
--enable-phpdbg-readline \
--with-pear \
--with-libdir="lib/${multiarch}" \
"${opcache[@]}"
"${options[@]}"

make -j "$(nproc)"
make install
Expand Down
Loading