diff --git a/AGENTS.md b/AGENTS.md index 2f40e62..e3889aa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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. diff --git a/Dockerfile b/Dockerfile index e5dd08c..52bc4b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -168,6 +168,13 @@ 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 \ @@ -175,18 +182,33 @@ RUN curl --retry 3 -fsSL \ 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 \ + && 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 @@ -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 diff --git a/README.md b/README.md index 628f4ba..90ac769 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -36,6 +36,8 @@ 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 | @@ -43,7 +45,7 @@ The entries below illustrate the configured PHP minor tag format: | `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 @@ -51,7 +53,7 @@ The workflow publishes the latest stable PHP patch in each configured minor line # 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" diff --git a/docker-bake.hcl b/docker-bake.hcl index 7d7bd47..69de0d5 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -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" { @@ -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" { diff --git a/docker/build-php.sh b/docker/build-php.sh index a239e97..7ab88aa 100644 --- a/docker/build-php.sh +++ b/docker/build-php.sh @@ -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 @@ -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 \ @@ -67,7 +74,6 @@ fi --enable-zts \ --enable-embed=shared \ --disable-zend-signals \ - --with-pic \ --with-mhash \ --enable-mbstring \ --enable-mysqlnd \ @@ -84,7 +90,7 @@ fi --enable-phpdbg-readline \ --with-pear \ --with-libdir="lib/${multiarch}" \ - "${opcache[@]}" + "${options[@]}" make -j "$(nproc)" make install