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
31 changes: 2 additions & 29 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ on:
# Weekly rebuild, so updates to the base images (new php.net patch
# releases in the official php images; rebuilds of the pinned
# dunglas/frankenphp version) and Alpine package fixes reach the tags
# without a Dockerfile change. Scheduled runs build everything except the
# EOL cli images (each build condition checks github.event_name) and skip
# without a Dockerfile change. Scheduled runs build everything and skip
# the layer cache (no-cache on each build step). A new FrankenPHP release
# still needs FRANKENPHP_VERSION bumped by hand.
schedule:
Expand All @@ -19,21 +18,6 @@ on:
required: false
default: false
type: boolean
build_php_74:
description: "Force build PHP 7.4 images"
required: false
default: false
type: boolean
build_php_80:
description: "Force build PHP 8.0 images"
required: false
default: false
type: boolean
build_php_81:
description: "Force build PHP 8.1 images"
required: false
default: false
type: boolean
build_php_82:
description: "Force build PHP 8.2 images"
required: false
Expand Down Expand Up @@ -82,9 +66,6 @@ jobs:
uses: tj-actions/changed-files@v47
with:
files: |
php/7.4/cli/Dockerfile
php/8.0/cli/Dockerfile
php/8.1/cli/Dockerfile
php/8.2/frankenphp/Dockerfile
php/8.2/frankenphp/Dockerfile.dev
php/8.2/frankenphp/Dockerfile.wordpress
Expand Down Expand Up @@ -125,9 +106,6 @@ jobs:
fail-fast: false
matrix:
include:
- { name: 7.4-cli, context: php/7.4/cli, file: php/7.4/cli/Dockerfile, platforms: "linux/amd64,linux/arm64", force_input: build_php_74, tag: 7.4-cli, eol: true }
- { name: 8.0-cli, context: php/8.0/cli, file: php/8.0/cli/Dockerfile, platforms: "linux/amd64,linux/arm64", force_input: build_php_80, tag: 8.0-cli, eol: true }
- { name: 8.1-cli, context: php/8.1/cli, file: php/8.1/cli/Dockerfile, platforms: "linux/amd64,linux/arm64", force_input: build_php_81, tag: 8.1-cli, eol: true }
- { name: 8.3-cli, context: php/8.3/cli, file: php/8.3/cli/Dockerfile, platforms: "linux/amd64,linux/arm64", force_input: build_php_83, tag: 8.3-cli }
- { name: 8.4-cli, context: php/8.4/cli, file: php/8.4/cli/Dockerfile, platforms: "linux/amd64,linux/arm64", force_input: build_php_84, tag: 8.4-cli }
- { name: 8.5-cli, context: php/8.5/cli, file: php/8.5/cli/Dockerfile, platforms: "linux/amd64,linux/arm64", force_input: build_php_85, tag: 8.5-cli }
Expand All @@ -150,9 +128,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push ${{ matrix.name }}
# EOL images (eol: true) skip the weekly rebuild: their Alpine branches get
# no updates, so it would only re-push identical images.
if: ${{ inputs.force_build_all || (github.event_name == 'schedule' && !matrix.eol) || inputs[matrix.force_input] || contains(needs.detect-changes.outputs.changed_files, matrix.file) }}
if: ${{ inputs.force_build_all || github.event_name == 'schedule' || inputs[matrix.force_input] || contains(needs.detect-changes.outputs.changed_files, matrix.file) }}
uses: docker/build-push-action@v7
with:
context: ${{ matrix.context }}
Expand Down Expand Up @@ -610,9 +586,6 @@ jobs:
echo "**Registry:** \`ghcr.io/${{ github.repository }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Available Images:**" >> $GITHUB_STEP_SUMMARY
echo "- **PHP 7.4:** \`7.4-cli-latest\`" >> $GITHUB_STEP_SUMMARY
echo "- **PHP 8.0:** \`8.0-cli-latest\`" >> $GITHUB_STEP_SUMMARY
echo "- **PHP 8.1:** \`8.1-cli-latest\`" >> $GITHUB_STEP_SUMMARY
echo "- **PHP 8.2:** \`8.2-frankenphp-latest\`, \`8.2-frankenphp-dev-latest\`, \`8.2-frankenphp-wordpress-latest\`" >> $GITHUB_STEP_SUMMARY
echo "- **PHP 8.3:** \`8.3-cli-latest\`, \`8.3-frankenphp-latest\`, \`8.3-frankenphp-dev-latest\`, \`8.3-frankenphp-wordpress-latest\`" >> $GITHUB_STEP_SUMMARY
echo "- **PHP 8.4:** \`8.4-cli-latest\`, \`8.4-frankenphp-latest\`, \`8.4-frankenphp-dev-latest\`, \`8.4-frankenphp-wordpress-latest\`" >> $GITHUB_STEP_SUMMARY
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
# docker-php

Docker images for PHP, published to `ghcr.io/aliasproject/php`. The primary offering is [FrankenPHP](https://frankenphp.dev/) (Caddy + PHP) for 8.2–8.5, plus CLI images for 7.4–8.1 and 8.3–8.5.
Docker images for PHP, published to `ghcr.io/aliasproject/php`. The primary offering is [FrankenPHP](https://frankenphp.dev/) (Caddy + PHP) for 8.2–8.5, plus CLI images for 8.3–8.5. Images for PHP versions past end of life (8.1 and older) are no longer built. Their last `7.4/8.0/8.1-cli-latest` tags are left in the registry, but they're unpatched (including for CVE-2026-109618/109619); move to `8.3-cli` or newer.

## Image matrix

| PHP | CLI | FrankenPHP | FrankenPHP (dev) | FrankenPHP (WordPress) |
|------|:---:|:----------:|:-----------------:|:------------------------:|
| 7.4 | ✅ | | | |
| 8.0 | ✅ | | | |
| 8.1 | ✅ | | | |
| 8.2 | | ✅ | ✅ | ✅ |
| 8.3 | ✅ | ✅ | ✅ | ✅ |
| 8.4 | ✅ | ✅ | ✅ | ✅ |
| 8.5 | ✅ | ✅ | ✅ | ✅ |

Tags follow `<version>-<variant>` (e.g. `8.4-frankenphp-wordpress`), each also published as `-latest` and as `-<sha>` for the commit it was built from. Every image except the EOL 7.4–8.1 CLI images is rebuilt weekly (Mondays 10:00 UTC) to pick up base-image and Alpine package updates, which also refreshes the `-<sha>` tag of the current commit; pin by digest (`@sha256:…`) for a byte-for-byte fixed image. The frankenphp images stay on their pinned FrankenPHP version, so a new FrankenPHP release (and the PHP version it ships) still needs `FRANKENPHP_VERSION` bumped in their Dockerfiles.
Tags follow `<version>-<variant>` (e.g. `8.4-frankenphp-wordpress`), each also published as `-latest` and as `-<sha>` for the commit it was built from. Every image is rebuilt weekly (Mondays 10:00 UTC) to pick up base-image and Alpine package updates, which also refreshes the `-<sha>` tag of the current commit; pin by digest (`@sha256:…`) for a byte-for-byte fixed image. The frankenphp images stay on their pinned FrankenPHP version, so a new FrankenPHP release (and the PHP version it ships) still needs `FRANKENPHP_VERSION` bumped in their Dockerfiles.

```sh
docker pull ghcr.io/aliasproject/php:8.4-frankenphp
```

## Variants

- **cli** — the PHP CLI with unlimited execution time. 8.3–8.5 are built on the official `php:<version>-cli-alpine` images, so a rebuild picks up the latest php.net patch release (7.4–8.1 still use Alpine's EOL packages). 8.3–8.5 are also rebuilt weekly (Mondays 10:00 UTC), so they pick up new PHP patch releases without a Dockerfile change. PHP's ini files are in `/usr/local/etc/php` (`conf.d/` for overrides). 8.3–8.5 are identical apart from the PHP version: a minimal extension set (`pdo_mysql`, `bcmath`, `intl`, `pcntl`, `zip`, etc.), a 512M memory limit, and an unprivileged `appuser` in group `0`. Backend and library extensions (`mysqli`, `gd`, `imagick`, `redis`, `igbinary`, …) belong in a derived image such as `php/8.4/cli/Dockerfile.wordpress`.
- **cli** — the PHP CLI with unlimited execution time, built on the official `php:<version>-cli-alpine` images, so each rebuild (including the weekly one) picks up the latest php.net patch release. PHP's ini files are in `/usr/local/etc/php` (`conf.d/` for overrides). The versions are identical apart from PHP itself: a minimal extension set (`pdo_mysql`, `bcmath`, `intl`, `pcntl`, `zip`, etc.), a 512M memory limit, and an unprivileged `appuser` in group `0`. Backend and library extensions (`mysqli`, `gd`, `imagick`, `redis`, `igbinary`, …) belong in a derived image such as `php/8.4/cli/Dockerfile.wordpress`.
- **frankenphp** — FrankenPHP serves PHP directly through Caddy; no separate web server. Minimal extension set, non-root by default, mail sent through `msmtp`, Composer baked in, `HEALTHCHECK` against Caddy's admin API.
- **frankenphp (dev)** — the FrankenPHP base with extra extensions (`mysqli`, `gd`, `exif`, `imagick`, `redis`, `igbinary`, `soap`) for local development.
- **frankenphp (wordpress)** — the FrankenPHP base with the same extensions as `dev`, plus a hardening policy suited to running WordPress (see below).
Expand Down
35 changes: 0 additions & 35 deletions php/7.4/cli/Dockerfile

This file was deleted.

35 changes: 0 additions & 35 deletions php/8.0/cli/Dockerfile

This file was deleted.

35 changes: 0 additions & 35 deletions php/8.1/cli/Dockerfile

This file was deleted.

Loading