diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index 46683fd..714faa4 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -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: @@ -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 @@ -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 @@ -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 } @@ -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 }} @@ -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 diff --git a/README.md b/README.md index 458f7a6..0728ca1 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,17 @@ # 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 `-` (e.g. `8.4-frankenphp-wordpress`), each also published as `-latest` and as `-` 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 `-` 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 `-` (e.g. `8.4-frankenphp-wordpress`), each also published as `-latest` and as `-` 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 `-` 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 @@ -22,7 +19,7 @@ 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:-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:-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). diff --git a/php/7.4/cli/Dockerfile b/php/7.4/cli/Dockerfile deleted file mode 100644 index 58286b5..0000000 --- a/php/7.4/cli/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM alpine:3.15.0 - -LABEL maintainer="Michael Aguiar " - -RUN apk add --no-cache \ - curl \ - php7 \ - php7-bcmath \ - php7-common \ - php7-ctype \ - php7-curl \ - php7-dom \ - php7-exif \ - php7-fileinfo \ - php7-gd \ - php7-iconv \ - php7-json \ - php7-mbstring \ - php7-mysqli \ - php7-opcache \ - php7-openssl \ - php7-pdo_mysql \ - php7-pecl-imagick \ - php7-phar \ - php7-session \ - php7-simplexml \ - php7-tokenizer \ - php7-xml \ - php7-xmlreader \ - php7-xmlwriter \ - php7-zip - -WORKDIR /app - -CMD ["php", "-a"] diff --git a/php/8.0/cli/Dockerfile b/php/8.0/cli/Dockerfile deleted file mode 100644 index 34e2f01..0000000 --- a/php/8.0/cli/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM alpine:3.15.0 - -LABEL maintainer="Michael Aguiar " - -RUN apk add --no-cache \ - curl \ - php8 \ - php8-bcmath \ - php8-common \ - php8-ctype \ - php8-curl \ - php8-dom \ - php8-exif \ - php8-fileinfo \ - php8-gd \ - php8-iconv \ - php8-mbstring \ - php8-mysqli \ - php8-opcache \ - php8-openssl \ - php8-pdo_mysql \ - php8-pecl-imagick \ - php8-phar \ - php8-session \ - php8-simplexml \ - php8-tokenizer \ - php8-xml \ - php8-xmlreader \ - php8-xmlwriter \ - php8-zip && \ - ln -s /usr/bin/php8 /usr/bin/php - -WORKDIR /app - -CMD ["php", "-a"] diff --git a/php/8.1/cli/Dockerfile b/php/8.1/cli/Dockerfile deleted file mode 100644 index e9c26d8..0000000 --- a/php/8.1/cli/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM alpine:3.16.0 - -LABEL maintainer="Michael Aguiar " - -RUN apk add --no-cache \ - curl \ - php81 \ - php81-bcmath \ - php81-common \ - php81-ctype \ - php81-curl \ - php81-dom \ - php81-exif \ - php81-fileinfo \ - php81-gd \ - php81-iconv \ - php81-mbstring \ - php81-mysqli \ - php81-opcache \ - php81-openssl \ - php81-pdo_mysql \ - php81-pecl-imagick \ - php81-phar \ - php81-session \ - php81-simplexml \ - php81-tokenizer \ - php81-xml \ - php81-xmlreader \ - php81-xmlwriter \ - php81-zip && \ - ln -s /usr/bin/php81 /usr/bin/php - -WORKDIR /app - -CMD ["php", "-a"]