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
80 changes: 7 additions & 73 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,8 @@ jobs:
with:
files: |
php/7.4/cli/Dockerfile
php/7.4/fpm/Dockerfile
php/7.4/fpm-nginx/Dockerfile
php/8.0/cli/Dockerfile
php/8.0/fpm/alpine/Dockerfile
php/8.0/fpm/ubuntu/Dockerfile
php/8.0/fpm-nginx/Dockerfile
php/8.1/cli/Dockerfile
php/8.1/fpm/Dockerfile
php/8.1/fpm-nginx/Dockerfile
php/8.2/fpm/Dockerfile
php/8.2/fpm-nginx/Dockerfile
php/8.2/frankenphp/Dockerfile
php/8.2/frankenphp/Dockerfile.dev
php/8.2/frankenphp/Dockerfile.wordpress
Expand Down Expand Up @@ -125,13 +116,8 @@ jobs:
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 }
- { name: 7.4-fpm, context: php/7.4/fpm, file: php/7.4/fpm/Dockerfile, platforms: "linux/amd64,linux/arm64", force_input: build_php_74, tag: 7.4-fpm }
- { 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 }
- { name: 8.0-fpm-alpine, context: php/8.0/fpm/alpine, file: php/8.0/fpm/alpine/Dockerfile, platforms: "linux/amd64,linux/arm64", force_input: build_php_80, tag: 8.0-fpm-alpine }
- { name: 8.0-fpm-ubuntu, context: php/8.0/fpm/ubuntu, file: php/8.0/fpm/ubuntu/Dockerfile, platforms: "linux/amd64", force_input: build_php_80, tag: 8.0-fpm-ubuntu }
- { 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 }
- { name: 8.1-fpm, context: php/8.1/fpm, file: php/8.1/fpm/Dockerfile, platforms: "linux/amd64,linux/arm64", force_input: build_php_81, tag: 8.1-fpm }
- { name: 8.2-fpm, context: php/8.2/fpm, file: php/8.2/fpm/Dockerfile, platforms: "linux/amd64,linux/arm64", force_input: build_php_82, tag: 8.2-fpm }
- { 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 Down Expand Up @@ -287,65 +273,13 @@ jobs:
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.version }}-frankenphp-${{ github.sha }} \
$(printf '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)

# Everything that's FROM an image build-base just pushed, minus frankenphp
# (that has its own dependent stage below). needs: build-base only pulls
# in the fast (<1 min) legs now that frankenphp moved out, so this no
# longer inherits frankenphp's build time at all.
build-dependent:
needs: [detect-changes, build-base]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- { name: 7.4-fpm-nginx, context: php/7.4/fpm-nginx, file: php/7.4/fpm-nginx/Dockerfile, parent_file: php/7.4/fpm/Dockerfile, platforms: "linux/amd64,linux/arm64", force_input: build_php_74, tag: 7.4-fpm-nginx }
- { name: 8.0-fpm-nginx, context: php/8.0/fpm-nginx, file: php/8.0/fpm-nginx/Dockerfile, parent_file: "", platforms: "linux/amd64,linux/arm64", force_input: build_php_80, tag: 8.0-fpm-nginx }
- { name: 8.1-fpm-nginx, context: php/8.1/fpm-nginx, file: php/8.1/fpm-nginx/Dockerfile, parent_file: php/8.1/fpm/Dockerfile, platforms: "linux/amd64,linux/arm64", force_input: build_php_81, tag: 8.1-fpm-nginx }
- { name: 8.2-fpm-nginx, context: php/8.2/fpm-nginx, file: php/8.2/fpm-nginx/Dockerfile, parent_file: php/8.2/fpm/Dockerfile, platforms: "linux/amd64,linux/arm64", force_input: build_php_82, tag: 8.2-fpm-nginx }
steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Set up QEMU
if: contains(matrix.platforms, 'arm64')
uses: docker/setup-qemu-action@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push ${{ matrix.name }}
if: ${{ inputs.force_build_all || inputs[matrix.force_input] || contains(needs.detect-changes.outputs.changed_files, matrix.file) || (matrix.parent_file != '' && contains(needs.detect-changes.outputs.changed_files, matrix.parent_file)) }}
uses: docker/build-push-action@v7
with:
context: ${{ matrix.context }}
file: ${{ matrix.file }}
push: true
platforms: ${{ matrix.platforms }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.tag }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.tag }}-latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.tag }}-${{ github.sha }}
cache-from: type=gha,scope=${{ matrix.name }}
cache-to: type=gha,mode=max,scope=${{ matrix.name }}

# frankenphp-dev and frankenphp-wordpress, same digest-split/native-arm64
# treatment as build-frankenphp-base and for the same reason: both FROM
# the frankenphp base and both install real extensions (wordpress in
# particular adds imagick, the single heaviest one in either Dockerfile).
# needs: merge-frankenphp-base (not build-base) so this only waits on the
# frankenphp base manifests actually being on the registry, not on the
# unrelated fast cli/fpm legs.
# unrelated fast cli legs.
build-frankenphp-dependent:
needs: [detect-changes, merge-frankenphp-base]
if: ${{ !cancelled() }}
Expand Down Expand Up @@ -482,7 +416,7 @@ jobs:

summary:
runs-on: ubuntu-latest
needs: [build-base, build-dependent, merge-frankenphp-base, merge-frankenphp-dependent]
needs: [build-base, merge-frankenphp-base, merge-frankenphp-dependent]
if: always()
steps:
- name: Build Summary
Expand All @@ -492,12 +426,12 @@ 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\`, \`7.4-fpm-latest\`, \`7.4-fpm-nginx-latest\`" >> $GITHUB_STEP_SUMMARY
echo "- **PHP 8.0:** \`8.0-cli-latest\`, \`8.0-fpm-alpine-latest\`, \`8.0-fpm-ubuntu-latest\`, \`8.0-fpm-nginx-latest\`" >> $GITHUB_STEP_SUMMARY
echo "- **PHP 8.1:** \`8.1-cli-latest\`, \`8.1-fpm-latest\`, \`8.1-fpm-nginx-latest\`" >> $GITHUB_STEP_SUMMARY
echo "- **PHP 8.2:** \`8.2-fpm-latest\`, \`8.2-fpm-nginx-latest\`, \`8.2-frankenphp-latest\`, \`8.2-frankenphp-dev-latest\`, \`8.2-frankenphp-wordpress-latest\`" >> $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
echo "- **PHP 8.5:** \`8.5-cli-latest\`, \`8.5-frankenphp-latest\`, \`8.5-frankenphp-dev-latest\`, \`8.5-frankenphp-wordpress-latest\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Status:** ${{ (needs.build-base.result == 'success' && needs.build-dependent.result == 'success' && needs.merge-frankenphp-base.result == 'success' && needs.merge-frankenphp-dependent.result == 'success') && '✅ All builds successful!' || '❌ Some builds failed' }}" >> $GITHUB_STEP_SUMMARY
echo "**Status:** ${{ (needs.build-base.result == 'success' && needs.merge-frankenphp-base.result == 'success' && needs.merge-frankenphp-dependent.result == 'success') && '✅ All builds successful!' || '❌ Some builds failed' }}" >> $GITHUB_STEP_SUMMARY
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# 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 the same versions. Older FPM-based images (7.4–8.2) remain published for existing consumers but are being phased out in favor of FrankenPHP.
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.

## Image matrix

| PHP | CLI | FPM | FPM + nginx | FrankenPHP | FrankenPHP (dev) | FrankenPHP (WordPress) |
|------|:---:|:----------------:|:-----------:|:----------:|:-----------------:|:------------------------:|
| 7.4 | ✅ | ✅ | ✅ | | | |
| 8.0 | ✅ | ✅ alpine/ubuntu | ✅ | | | |
| 8.1 | ✅ | ✅ | ✅ | | | |
| 8.2 | | ✅ | ✅ | ✅ | ✅ | ✅ |
| 8.3 | ✅ | | | ✅ | ✅ | ✅ |
| 8.4 | ✅ | | | ✅ | ✅ | ✅ |
| 8.5 | ✅ | | | ✅ | ✅ | ✅ |
| 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 pinned to a commit as `-<sha>`.

Expand All @@ -23,8 +23,6 @@ docker pull ghcr.io/aliasproject/php:8.4-frankenphp
## Variants

- **cli** — Alpine + the PHP CLI SAPI and a minimal extension set (`pdo_mysql`, `bcmath`, `pcntl`, `posix`, etc.), unlimited execution time, runs as an unprivileged `appuser` in group `0`.
- **fpm** *(legacy)* — PHP-FPM under s6-overlay, configurable pool sizing via `PHP_PM_*` env vars.
- **fpm-nginx** *(legacy)* — the `fpm` image plus nginx in front of it.
- **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
43 changes: 0 additions & 43 deletions php/7.4/fpm-nginx/Dockerfile

This file was deleted.

14 changes: 0 additions & 14 deletions php/7.4/fpm-nginx/etc/msmtprc

This file was deleted.

83 changes: 0 additions & 83 deletions php/7.4/fpm-nginx/etc/nginx/conf.d/default.conf

This file was deleted.

69 changes: 0 additions & 69 deletions php/7.4/fpm-nginx/etc/nginx/nginx.conf

This file was deleted.

21 changes: 0 additions & 21 deletions php/7.4/fpm-nginx/etc/nginx/php_fastcgi.conf

This file was deleted.

Loading
Loading