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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
php_version: [ '83', '84', '85' ]
php_version: [ '83', '84', '85', '86' ]
steps:
- uses: actions/checkout@v6

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
script: |
const matrix = {
platform: ['linux/amd64', 'linux/arm64'],
php_version: ['83', '84', '85'],
php_version: ['83', '84', '85', '86'],
}

// If this is a third-party pull request, skip ARM builds
Expand Down
42 changes: 37 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,13 @@ ENV MAKEFLAGS='-j4'
# --fail makes sure that curl returns an error instead of fetching the 404 page
ARG FULL_PHP_VERSION
WORKDIR /tmp/php
RUN curl --location --silent --show-error --fail --retry 3 "https://www.php.net/distributions/php-${FULL_PHP_VERSION}.tar.gz" \
| tar xzC . --strip-components=1
# Pre-releases (alpha, beta, RC) are not on php.net/distributions: take the tag's source from GitHub
# (without the generated files, which `buildconf` below generates)
RUN case "${FULL_PHP_VERSION}" in \
*alpha*|*beta*|*RC*) url="https://github.com/php/php-src/archive/refs/tags/php-${FULL_PHP_VERSION}.tar.gz" ;; \
*) url="https://www.php.net/distributions/php-${FULL_PHP_VERSION}.tar.gz" ;; \
esac; \
curl --location --silent --show-error --fail --retry 3 "$url" | tar xzC . --strip-components=1

# Configure the build
# -fstack-protector-strong : Be paranoid about stack overflows
Expand Down Expand Up @@ -141,8 +146,25 @@ RUN set -xe; \
make clean

# Optional extensions installed with `pecl`, not enabled by default
RUN pecl install APCu
RUN pecl install redis-6.3.0
ARG PHP_VERSION
# APCu's latest release (5.1.28) does not compile with PHP 8.6: use its main branch (pinned) until 5.1.29
RUN if [ "${PHP_VERSION}" -ge 86 ]; then \
mkdir -p /tmp/apcu && cd /tmp/apcu \
&& curl --location --silent --show-error --fail --retry 3 https://github.com/krakjoe/apcu/archive/fb2c942552a3f5dab7f4dea4afb5cf0831222c57.tar.gz \
| tar xzC . --strip-components=1 \
&& phpize && ./configure && make && make install && cd / && rm -rf /tmp/apcu; \
else \
pecl install APCu; \
fi
# phpredis' latest release (6.3.0) does not compile with PHP 8.6: use its develop branch (pinned) until the next release
RUN if [ "${PHP_VERSION}" -ge 86 ]; then \
mkdir -p /tmp/redis && cd /tmp/redis \
&& curl --location --silent --show-error --fail --retry 3 https://github.com/phpredis/phpredis/archive/959dee1ca9ed55500cf90365419f8232eca3a99c.tar.gz \
| tar xzC . --strip-components=1 \
&& phpize && ./configure && make && make install && cd / && rm -rf /tmp/redis; \
else \
pecl install redis-6.3.0; \
fi

# Gather all extensions in one directory, independent of PHP's internal API version
RUN set -xe; \
Expand Down Expand Up @@ -237,7 +259,17 @@ FROM build-environment AS build-php
# Build the dev image with xdebug
FROM build-environment AS build-dev

RUN pecl install xdebug-3.5.0 && cp "$(php -r 'echo ini_get("extension_dir");')"/xdebug.so /tmp/xdebug.so
ARG PHP_VERSION
# xdebug's latest release (3.5.3) supports PHP up to 8.5: use its main branch (pinned) for PHP 8.6
RUN if [ "${PHP_VERSION}" -ge 86 ]; then \
mkdir -p /tmp/xdebug && cd /tmp/xdebug \
&& curl --location --silent --show-error --fail --retry 3 https://github.com/xdebug/xdebug/archive/64007df3a0925808022fb87b6c6f06febf058ee2.tar.gz \
| tar xzC . --strip-components=1 \
&& phpize && ./configure --enable-xdebug && make && make install && cd / && rm -rf /tmp/xdebug; \
else \
pecl install xdebug-3.5.0; \
fi; \
cp "$(php -r 'echo ini_get("extension_dir");')"/xdebug.so /tmp/xdebug.so


FROM php AS dev
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ default: docker-images


# Build Docker images *locally*
docker-images: docker-images-php-83 docker-images-php-84 docker-images-php-85
docker-images: docker-images-php-83 docker-images-php-84 docker-images-php-85 docker-images-php-86
docker-images-php-%:
PHP_VERSION=$* ${BAKE_COMMAND} --load


# Build and publish multi-architecture images to Docker Hub.
upload-to-docker-hub: upload-to-docker-hub-php-83 upload-to-docker-hub-php-84 upload-to-docker-hub-php-85
upload-to-docker-hub: upload-to-docker-hub-php-83 upload-to-docker-hub-php-84 upload-to-docker-hub-php-85 upload-to-docker-hub-php-86
upload-to-docker-hub-php-%:
# Make sure we have defined the docker tag
(test $(DOCKER_TAG)) && echo "Tagging images with \"${DOCKER_TAG}\"" || echo "You have to define environment variable DOCKER_TAG"
Expand All @@ -48,12 +48,12 @@ upload-to-docker-hub-php-%:
--set "php-dev.tags=bref/php-$*-dev:4" --set "php-dev.tags=bref/php-$*-dev:${DOCKER_TAG}"


test: test-83 test-84 test-85
test: test-83 test-84 test-85 test-86
test-%:
cd tests && $(MAKE) test-$*


clean: clean-83 clean-84 clean-85
clean: clean-83 clean-84 clean-85 clean-86
# Clear the build cache, else all images will be rebuilt using cached layers
docker builder prune
clean-%:
Expand Down
2 changes: 2 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ variable "FULL_PHP_VERSIONS" {
"83" = "8.3.37"
"84" = "8.4.28"
"85" = "8.5.13"
# Release candidate: final release planned for late November 2026
"86" = "8.6.0RC5"
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

test: test-83 test-84 test-85
test: test-83 test-84 test-85 test-86

# This rule matches with a wildcard, for example `test-84`.
# The `$*` variable will contained the matched part, in this case `84`.
Expand Down