This repository builds the PHP images ghcr.io/rapira-rs/php.
- PHP 8.4, 8.5 and 8.6.
- Suites:
trixieandbookworm(Debian),alpine3.24andalpine3.23(Alpine). - Variants:
nts(not thread-safe) andzts(thread-safe). Both are the cli build of the official image, withlibphp.so. - Platforms:
linux/amd64andlinux/arm64.
| Tag | Example | Image |
|---|---|---|
<X.Y.Z>-<suite>-<variant> |
8.5.13-alpine3.24-nts |
one patch release |
<X.Y>-<suite>-<variant> |
8.5-alpine3.24-nts |
the newest patch release of the minor |
<X.Y.Z>-<variant> and <X.Y>-<variant> |
8.5-nts |
the same as the trixie tags |
The images have the PHP extensions of the official image and its helper commands: docker-php-ext-install, docker-php-ext-enable, docker-php-ext-configure and docker-php-source. Add extensions with these commands:
FROM ghcr.io/rapira-rs/php:8.5-nts
RUN docker-php-ext-install bcmathThe Rapira image ghcr.io/rapira-rs/rapira builds on the official PHP images (php:8.4-zts-trixie, php:8.5-zts-trixie and php:8.6-cli-trixie).
- PHP comes from the signed php-src tag
php-X.Y.Z. The build verifies the tag with the keys of the release managers of the minor and makes the source tarball withscripts/dev/makedist. - Each minor has an
ntsand aztsimage. The official 8.6 images are ZTS only. - Each image has
libphp.so. - The build installs the newest packages of the suite.
versions.json holds the PHP version of each minor. Renovate checks the php-src tags every 15 minutes, with the config in renovate.json. For a new patch tag php-X.Y.Z, it opens a pull request that changes the version of the minor, and merges it when the Verify Templating check passes.
The PHP images workflow builds the images of a minor when its version changes on main. It builds the images of all minors when a generated Dockerfile or a docker-php-* script changes. A weekly workflow_dispatch with force builds all images again, so that they get the newest packages of the suite.
Renovate and the weekly dispatch run as CronJobs in a Kubernetes cluster of the owner and sign in as the GitHub App rapira-renovate.
The Dockerfiles in <minor>/<suite>/<variant>/ are generated. Do not edit them.
- Edit
Dockerfile-linux.templateorversions.json. - Run
./apply-templates.sh. It needs bash, gawk, jq and wget. - Commit the template,
versions.jsonand the generated files together. TheVerify Templatingworkflow fails when they differ.
versions.json lists the minors, the PHP version of each minor and its variants. A new minor also needs the keys of its release managers in the GPG_KEYS block of the template.
Build one image locally from the repository root:
docker build -f 8.5/alpine3.24/nts/Dockerfile --build-arg PHP_VERSION=8.5.13 .PHP_VERSION must be 8.4.28, 8.5.13, 8.6.0 or a newer patch release of the minor. For older tags, makedist downloads the PEAR installer with wget, and the source stage has no wget.
The template is based on Dockerfile-linux.template of docker-library/php at commit 3b25f4162a9bd144d3f447d03cb8fe16c0d2c9cc. Upstream changes are copied by hand.
MIT, see LICENSE. The template, apply-templates.sh and the docker-php-* scripts come from docker-library/php under the MIT license, Copyright (c) 2014 Docker, Inc., see LICENSE.docker-library.